chiark / gitweb /
[PATCH] fix UDEV_NO_SLEEP
authortrini@kernel.crashing.org <trini@kernel.crashing.org>
Wed, 11 Aug 2004 08:02:59 +0000 (01:02 -0700)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:36:59 +0000 (21:36 -0700)
Move setting UDEV_NO_SLEEP into main().  I thought about moving
udev_init_config() around, but it still must be invoked in both udev and
udevstart cases, and before udev_hotplug() is called.  An alternative
would be to have main() do:
if (is_udevstart) {
... current ...
} else {
udev_init_config();
return udev_hotplug();
}

And move setting UDEV_NO_SLEEP into udev_start().  I can redo it that
way, if you prefer.

Signed-off-by: Tom Rini <trini@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
udev.c
udevstart.c

diff --git a/udev.c b/udev.c
index 0ef4cf8657f17d79e0bf3628fb7a5ec15e7ff8c6..90c34d800a9ca22533f276bf475cd7dc6a450e3a 100644 (file)
--- a/udev.c
+++ b/udev.c
@@ -174,8 +174,11 @@ int main(int argc, char *argv[], char *envp[])
        main_argv = argv;
        main_envp = envp;
 
        main_argv = argv;
        main_envp = envp;
 
-       if (strstr(argv[0], "udevstart"))
+       if (strstr(argv[0], "udevstart")) {
+               /* Setup env variables. */
+               setenv("UDEV_NO_SLEEP", "1", 1);
                is_udevstart = 1;
                is_udevstart = 1;
+       }
 
        /* initialize our configuration */
        udev_init_config();
 
        /* initialize our configuration */
        udev_init_config();
index d94c9501c93a8884d2a39df006cbb8afe14b9ab6..2d5553e95529c8870aa21c622d361e69c5a5abaa 100644 (file)
@@ -75,9 +75,6 @@ static int device_list_insert(char *path, char *subsystem, struct list_head *dev
 
 static void udev_exec(const char *path, const char* subsystem)
 {
 
 static void udev_exec(const char *path, const char* subsystem)
 {
-       /* Setup env variables. */
-       setenv("UDEV_NO_SLEEP", "1", 1);
-
        /* Now call __udev_hotplug(). */
        if (__udev_hotplug("add", path, subsystem)) {
                dbg("Calling of udev_hotplug failed");
        /* Now call __udev_hotplug(). */
        if (__udev_hotplug("add", path, subsystem)) {
                dbg("Calling of udev_hotplug failed");