chiark / gitweb /
[PATCH] finally solve the bad sysfs-timing for all of us
[elogind.git] / udevtest.c
index 67ae9cc98f4694dafd8c87f2f037f006035027a8..df882d2d8cde6858c8f93f1c3b366bc0b7dbe636 100644 (file)
@@ -57,8 +57,7 @@ int main(int argc, char *argv[], char *envp[])
 {
        char *devpath;
        char temp[NAME_SIZE];
-       char subsystem[] = "";
-       const int fake = 1;
+       char *subsystem = "";
 
        main_argv = argv;
        main_envp = envp;
@@ -98,8 +97,11 @@ int main(int argc, char *argv[], char *envp[])
        /* initialize the naming deamon */
        namedev_init();
 
+       if (argv[2] != NULL)
+               subsystem = argv[2];
+
        /* simulate node creation with fake flag */
-       udev_add_device(devpath, subsystem, fake);
+       udev_add_device(devpath, subsystem, FAKE);
 
 exit:
        return 0;