chiark / gitweb /
[PATCH] Don't try to print major/minor for devices without a dev file.
[elogind.git] / udevinfo.c
index 013068541e82eba50ebd62fdd5c479ab8f5b8085..901990ede6ca52527ac0e895e429317a0d5b83c1 100644 (file)
@@ -142,7 +142,7 @@ static int print_device_chain(const char *path)
 
        /* look for the 'dev' file */
        attr = sysfs_get_classdev_attr(class_dev, "dev");
-       if (attr == NULL)
+       if (attr != NULL)
                printf("device '%s' has major:minor %s", class_dev->path, attr->value);
 
        /* open sysfs class device directory and print all attributes */