chiark / gitweb /
[PATCH] udev - allow all files in a directory as the config
[elogind.git] / udev.c
diff --git a/udev.c b/udev.c
index ce6d6ce9df22a7b2cb9ab3bb84133d25906d2d18..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) {