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"
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];
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();
sysbus_disconnect();
exit:
- return retval;
+ if (retval > 0)
+ retval = 0;
+
+ return -retval;
}
int main(int argc, char **argv, char **envp)
{
+ int retval;
main_argv = argv;
main_envp = envp;
- int retval;
dbg("version %s", UDEV_VERSION);