chiark / gitweb /
[PATCH] do not remove real .udev.tdb during RPM build
[elogind.git] / udev.c
diff --git a/udev.c b/udev.c
index 9f10cc212539466e5e03edc05016976d90069e24..1c65f2e59c5063753fc92e7c5cb5a134c22ddc1f 100644 (file)
--- a/udev.c
+++ b/udev.c
 #include <ctype.h>
 #include <signal.h>
 
+#include "libsysfs/sysfs/libsysfs.h"
 #include "udev.h"
 #include "udev_version.h"
 #include "udev_dbus.h"
 #include "logging.h"
 #include "namedev.h"
 #include "udevdb.h"
-#include "libsysfs/libsysfs.h"
 
 /* global variables */
 char **main_argv;
@@ -111,13 +111,13 @@ static int udev_hotplug(int argc, char **argv)
 
        action = get_action();
        if (!action) {
-               dbg ("no action?");
+               dbg("no action?");
                goto exit;
        }
 
        devpath = get_devpath();
        if (!devpath) {
-               dbg ("no devpath?");
+               dbg("no devpath?");
                goto exit;
        }
        dbg("looking at '%s'", devpath);
@@ -131,6 +131,10 @@ static int udev_hotplug(int argc, char **argv)
 
        /* skip blacklisted subsystems */
        subsystem = argv[1];
+       if (!subsystem) {
+               dbg("no subsystem?");
+               goto exit;
+       }
        i = 0;
        while (subsystem_blacklist[i][0] != '\0') {
                if (strcmp(subsystem, subsystem_blacklist[i]) == 0) {
@@ -164,7 +168,7 @@ static int udev_hotplug(int argc, char **argv)
        namedev_init();
 
        if (strcmp(action, "add") == 0)
-               retval = udev_add_device(devpath, subsystem);
+               retval = udev_add_device(devpath, subsystem, 0);
 
        else if (strcmp(action, "remove") == 0)
                retval = udev_remove_device(devpath, subsystem);