chiark / gitweb /
fix the fix and change the file to wait for to the "bus" link
[elogind.git] / udevinfo.c
index 788dd519a86e97cdf7e2d8d6cbac398189773a6a..69e5335b7cef9d26d099c72c8bf45adadac0c483 100644 (file)
@@ -152,19 +152,16 @@ static int print_device_chain(const char *path)
 
        /* look the device chain upwards */
        while (sysfs_dev != NULL) {
-               attr_list = sysfs_get_device_attributes(sysfs_dev);
-               if (attr_list == NULL) {
-                       fprintf(stderr, "couldn't open device directory\n");
-                       retval = -1;
-                       goto exit;
-               }
-
                printf("  looking at the device chain at '%s':\n", sysfs_dev->path);
                printf("    BUS==\"%s\"\n", sysfs_dev->bus);
                printf("    ID==\"%s\"\n", sysfs_dev->bus_id);
                printf("    DRIVER==\"%s\"\n", sysfs_dev->driver_name);
 
-               print_all_attributes(attr_list);
+               attr_list = sysfs_get_device_attributes(sysfs_dev);
+               if (attr_list != NULL)
+                       print_all_attributes(attr_list);
+               else
+                       printf("\n");
 
                sysfs_dev = sysfs_get_device_parent(sysfs_dev);
                if (sysfs_dev == NULL)
@@ -199,7 +196,7 @@ int main(int argc, char *argv[], char *envp[])
        logging_init("udevinfo");
 
        udev_init_config();
-       udev_init_device(&udev, NULL, NULL);
+       udev_init_device(&udev, NULL, NULL, NULL);
 
        /* get command line options */
        while (1) {