chiark / gitweb /
[PATCH] small cleanup
[elogind.git] / udev.c
diff --git a/udev.c b/udev.c
index 1797e08273a3bdaceda83dca1d004f6edd21fc2e..bbff89bad5165ca1ee50ed98f2c6950d95cf704c 100644 (file)
--- a/udev.c
+++ b/udev.c
@@ -130,7 +130,7 @@ static inline int udev_user(int argc, char **argv)
 
 help:
        printf("Usage: [-qrVh]\n"
-              "  -q arg     query database \n"
+              "  -q <path>  query database for the name of the created node\n"
               "  -r         print udev root\n"
               "  -V         print udev version\n"
               "  -h         print this help text\n"
@@ -139,12 +139,20 @@ help:
        return retval;
 }
 
+static char *subsystem_blacklist[] = {
+       "net",
+       "scsi_host",
+       "scsi_device",
+       "",
+};
+
 static inline int udev_hotplug(int argc, char **argv)
 {
        char *action;
        char *devpath;
        char *subsystem;
        int retval = -EINVAL;
+       int i;
 
        subsystem = argv[1];
 
@@ -162,10 +170,14 @@ static inline int udev_hotplug(int argc, char **argv)
                goto exit;
        }
 
-       /* but we don't care about net class devices */
-       if (strcmp(subsystem, "net") == 0) {
-               dbg("don't care about net devices");
-               goto exit;
+       /* skip blacklisted subsystems */
+       i = 0;
+       while (subsystem_blacklist[i][0] != '\0') {
+               if (strcmp(subsystem, subsystem_blacklist[i]) == 0) {
+                       dbg("don't care about '%s' devices", subsystem);
+                       goto exit;
+               }
+               i++;
        }
 
        action = get_action();
@@ -209,7 +221,7 @@ exit_sysbus:
        sysbus_disconnect();
 
 exit:
-       return retval;
+       return -retval;
 }
 
 int main(int argc, char **argv, char **envp)