chiark / gitweb /
rule-generator: net - whitelist NICs that violate MAC local scheme
[elogind.git] / udev / udevadm-info.c
index 78c218eef0b22355d2d08a74c4d76a309b1f3a8a..f20eb07e046bd462f576c45967746e21f368428c 100644 (file)
@@ -60,7 +60,7 @@ static void print_all_attributes(struct udev_device *device, const char *key)
                        if (S_ISLNK(statbuf.st_mode))
                                continue;
 
-                       value = udev_device_get_attr_value(device, dent->d_name);
+                       value = udev_device_get_sysattr_value(device, dent->d_name);
                        if (value == NULL)
                                continue;
                        dbg(udev, "attr '%s'='%s'(%zi)\n", dent->d_name, value, len);
@@ -87,7 +87,7 @@ static int print_device_chain(struct udev_device *device)
        const char *str;
 
        printf("\n"
-              "Udevinfo starts with the device specified by the devpath and then\n"
+              "Udevadm info starts with the device specified by the devpath and then\n"
               "walks up the chain of parent devices. It prints for every device\n"
               "found, all possible attributes in the udev rules key format.\n"
               "A rule to match, can be composed by the attributes of the device\n"
@@ -153,6 +153,10 @@ static void print_record(struct udev_device *device)
        if (i != 0)
                printf("R:%u\n", i);
 
+       i = udev_device_get_watch_handle(device);
+       if (i >= 0)
+               printf("W:%u\n", i);
+
        udev_list_entry_foreach(list_entry, udev_device_get_devlinks_list_entry(device)) {
                len = strlen(udev_get_dev_path(udev_device_get_udev(device)));
                printf("S: %s\n", &udev_list_entry_get_name(list_entry)[len+1]);
@@ -198,8 +202,7 @@ static int export_devices(struct udev *udev)
 
                device = udev_device_new_from_syspath(udev, udev_list_entry_get_name(list_entry));
                if (device != NULL) {
-                       if (udev_device_get_devnode(device) != NULL)
-                               print_record(device);
+                       print_record(device);
                        udev_device_unref(device);
                }
        }
@@ -228,7 +231,7 @@ int udevadm_info(struct udev *udev, int argc, char *argv[])
                { "device-id-of-file", required_argument, NULL, 'd' },
                { "export", no_argument, NULL, 'x' },
                { "export-prefix", required_argument, NULL, 'P' },
-               { "version", no_argument, NULL, 1 }, /* -V outputs braindead format */
+               { "version", no_argument, NULL, 'V' },
                { "help", no_argument, NULL, 'h' },
                {}
        };
@@ -366,11 +369,8 @@ int udevadm_info(struct udev *udev, int argc, char *argv[])
                case 'P':
                        export_prefix = optarg;
                        break;
-               case 1:
-                       printf("%s\n", VERSION);
-                       goto exit;
                case 'V':
-                       printf("udevinfo, version %s\n", VERSION);
+                       printf("%s\n", VERSION);
                        goto exit;
                case 'h':
                        printf("Usage: udevadm info OPTIONS\n"
@@ -387,8 +387,7 @@ int udevadm_info(struct udev *udev, int argc, char *argv[])
                               "                             of parent devices\n"
                               "  --device-id-of-file=<file> print major:minor of device containing this file\n"
                               "  --export-db                export the content of the udev database\n"
-                              "  --help                     print this text\n"
-                              "\n");
+                              "  --help\n\n");
                        goto exit;
                default:
                        goto exit;