1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-08 20:58:20 +03:00

[PATCH] check earlier if we should run as udevstart

This commit is contained in:
kay.sievers@vrfy.org 2004-12-12 03:29:59 +01:00 committed by Greg KH
parent 8544c9ad4f
commit 7e0bd58475

16
udev.c
View File

@ -128,14 +128,6 @@ int main(int argc, char *argv[], char *envp[])
/* 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") || (argc == 2 && strstr(argv[1], "udevstart"))) {
dbg("udevstart");
@ -147,6 +139,14 @@ int main(int argc, char *argv[], char *envp[])
goto exit;
}
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 (!action) {
dbg("no action");
goto hotplug;