chiark / gitweb /
[PATCH] don't init namedev on remove
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>
Wed, 24 Mar 2004 02:54:34 +0000 (18:54 -0800)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:35:10 +0000 (21:35 -0700)
Is there any reason to parse the rules for a remove event?
Without it, our test script needs only 2.1 seconds instead of 2.5,
so we have 19 percent more time for testing now :)

udev.c

diff --git a/udev.c b/udev.c
index d10badc8eaff1bedd93f7c83408fa233bddcf58e..1220e637e5ce1befce760ac9231dbf2e95814bae 100644 (file)
--- a/udev.c
+++ b/udev.c
@@ -140,19 +140,18 @@ static int udev_hotplug(void)
        sigaction(SIGINT, &act, NULL);
        sigaction(SIGTERM, &act, NULL);
 
        sigaction(SIGINT, &act, NULL);
        sigaction(SIGTERM, &act, NULL);
 
-       /* initialize the naming deamon */
-       namedev_init();
-
-       if (strcmp(action, "add") == 0)
+       if (strcmp(action, "add") == 0) {
+               namedev_init();
                retval = udev_add_device(devpath, subsystem, 0);
                retval = udev_add_device(devpath, subsystem, 0);
-
-       else if (strcmp(action, "remove") == 0)
-               retval = udev_remove_device(devpath, subsystem);
-
-       else {
-               dbg("unknown action '%s'", action);
-               retval = -EINVAL;
+       } else {
+               if (strcmp(action, "remove") == 0) {
+                       retval = udev_remove_device(devpath, subsystem);
+               } else {
+                       dbg("unknown action '%s'", action);
+                       retval = -EINVAL;
+               }
        }
        }
+
        udevdb_exit();
 
 exit_sysbus:
        udevdb_exit();
 
 exit_sysbus: