chiark / gitweb /
[PATCH] don't call the hotplug scripts with a test run
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>
Thu, 25 Nov 2004 09:15:32 +0000 (10:15 +0100)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 06:00:29 +0000 (23:00 -0700)
test/udev-test.pl
udev.c
udev.h
udev_config.c

index d584579584ba2b7bb7606ba2ebaed0d32ba26d93..593e34e885600b26f84e8d4251492928f205dc36 100644 (file)
@@ -1153,6 +1153,7 @@ $ENV{UDEV_TEST} = "yes";
 $ENV{SYSFS_PATH} = $sysfs;
 $ENV{UDEV_CONFIG_FILE} = $main_conf;
 $ENV{UDEV_NO_DEVD} = "yes";
+$ENV{UDEV_NO_HOTPLUGD} = "yes";
 
 
 sub udev {
diff --git a/udev.c b/udev.c
index 35fa533a4e76d6f49747cd9c12b7dd9d7ef596af..3a97eb1046d006009abf65053cfdfabcb7c8916b 100644 (file)
--- a/udev.c
+++ b/udev.c
@@ -223,7 +223,7 @@ int main(int argc, char *argv[], char *envp[])
        }
 
 hotplug:
-       if (manage_hotplug_event())
+       if (udev_hotplug_d && manage_hotplug_event())
                udev_multiplex_directory(&udev, HOTPLUGD_DIR, HOTPLUG_SUFFIX);
 
 exit:
diff --git a/udev.h b/udev.h
index 1e3db5af27e95c4309e4ec24096ee43e8ba2f73c..ace843f0ad2f33166fe565da84129ff3a0d077e1 100644 (file)
--- a/udev.h
+++ b/udev.h
@@ -91,5 +91,6 @@ extern char default_owner_str[OWNER_SIZE];
 extern char default_group_str[GROUP_SIZE];
 extern int udev_log;
 extern int udev_dev_d;
+extern int udev_hotplug_d;
 
 #endif
index 51bdc720a73333126b6173001714fef0263711b7..9549471b8bc718455eb34587cac47d9b1a49bf8c 100644 (file)
@@ -51,6 +51,7 @@ char default_owner_str[OWNER_SIZE];
 char default_group_str[GROUP_SIZE];
 int udev_log;
 int udev_dev_d;
+int udev_hotplug_d;
 
 
 static int string_is_true(char *str)
@@ -68,7 +69,7 @@ static void init_variables(void)
 {
        char *env;
 
-       /* fill up the defaults.  
+       /* fill up the defaults.
         * If any config values are specified, they will
         * override these values. */
        strfieldcpy(udev_root, UDEV_ROOT);
@@ -82,6 +83,11 @@ static void init_variables(void)
        env = getenv("UDEV_NO_DEVD");
        if (env && string_is_true(env))
                udev_dev_d = 0;
+
+       udev_hotplug_d = 1;
+       env = getenv("UDEV_NO_HOTPLUGD");
+       if (env && string_is_true(env))
+               udev_hotplug_d = 0;
 }
 
 int parse_get_pair(char **orig_string, char **left, char **right)