X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udev.c;h=192bed97d812238ba26a0c17610d6694afbb607d;hb=eab52c24431b4305708a7579a823585555b8f33b;hp=52b98c8d452efb8d99a94a82005d42ce797479ba;hpb=7e371e86a420cb82948b72ca3dd93915cb8dd764;p=elogind.git diff --git a/udev.c b/udev.c index 52b98c8d4..192bed97d 100644 --- a/udev.c +++ b/udev.c @@ -68,7 +68,6 @@ static void sig_handler(int signum) } static char *subsystem_blacklist[] = { - "net", "scsi_host", "scsi_device", "usb_host", @@ -85,6 +84,7 @@ static int udev_hotplug(void) int retval = -EINVAL; int i; struct sigaction act; + const int nofake = 0; action = get_action(); if (!action) { @@ -137,23 +137,23 @@ static int udev_hotplug(void) if (strcmp(action, "add") == 0) { namedev_init(); - 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; - } + retval = udev_add_device(devpath, subsystem, nofake); + goto action_done; + } + + if (strcmp(action, "remove") == 0) { + retval = udev_remove_device(devpath, subsystem); + goto action_done; } + dbg("unknown action '%s'", action); + retval = -EINVAL; + +action_done: udevdb_exit(); exit: - if (retval > 0) - retval = 0; - - return -retval; + return retval; } int main(int argc, char *argv[], char *envp[])