summaryrefslogtreecommitdiff
path: root/udev.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-11-29 02:15:55 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 23:00:29 -0700
commit2af003feb21e79b68b048c212bb898b293b75421 (patch)
tree1c24d3eb3b5f10de32f57adee2054c78a9d27354 /udev.c
parent45a7b668eca398831c0cfc39e4237494b3d603e9 (diff)
[PATCH] trivial cleanups and change some comments
Diffstat (limited to 'udev.c')
-rw-r--r--udev.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/udev.c b/udev.c
index 847cc5dade..ca79bb4ec0 100644
--- a/udev.c
+++ b/udev.c
@@ -111,17 +111,22 @@ int main(int argc, char *argv[], char *envp[])
act.sa_handler = (void (*) (int))sig_handler;
sigemptyset (&act.sa_mask);
act.sa_flags = 0;
- /* alarm must not restart syscalls*/
sigaction(SIGALRM, &act, NULL);
sigaction(SIGINT, &act, NULL);
sigaction(SIGTERM, &act, NULL);
- /* trigger timeout to interrupt blocking syscalls */
+ /* trigger timeout to prevent hanging processes */
alarm(ALARM_TIMEOUT);
+ action = getenv("ACTION");
+ devpath = getenv("DEVPATH");
+ subsystem = getenv("SUBSYSTEM");
+ /* older kernels passed the SUBSYSTEM only as argument */
+ if (!subsystem && argc == 2)
+ subsystem = argv[1];
udev_init_device(&udev, devpath, subsystem);
- if (strstr(argv[0], "udevstart") || (argv[1] != NULL && strstr(argv[1], "udevstart"))) {
+ if (strstr(argv[0], "udevstart") || (argc == 2 && strstr(argv[1], "udevstart"))) {
dbg("udevstart");
/* disable all logging, as it's much too slow on some facilities */