summaryrefslogtreecommitdiff
path: root/udev/udevadm-info.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2008-10-03 10:33:15 +0200
committerKay Sievers <kay.sievers@vrfy.org>2008-10-03 10:33:15 +0200
commitee137da3897d154e0c62b03ea7ef3c3359753adc (patch)
treea1447cf8bd6bc9191d8f797edd132ca4f8882b46 /udev/udevadm-info.c
parent2f1a291e2f50075e46cd55568a5ba6ba4f6a2afc (diff)
udevadm: info - fix --query=all for devices without a device node
Diffstat (limited to 'udev/udevadm-info.c')
-rw-r--r--udev/udevadm-info.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/udev/udevadm-info.c b/udev/udevadm-info.c
index ec098abd18..b18f249495 100644
--- a/udev/udevadm-info.c
+++ b/udev/udevadm-info.c
@@ -130,13 +130,16 @@ static int print_device_chain(struct udev_device *device)
static void print_record(struct udev_device *device)
{
size_t len;
+ const char *str;
int i;
struct udev_list_entry *list_entry;
printf("P: %s\n", udev_device_get_devpath(device));
len = strlen(udev_get_dev_path(udev_device_get_udev(device)));
- printf("N: %s\n", &udev_device_get_devnode(device)[len+1]);
+ str = udev_device_get_devnode(device);
+ if (str != NULL)
+ printf("N: %s\n", &str[len+1]);
i = device_get_devlink_priority(device);
if (i != 0)
@@ -159,7 +162,6 @@ static void print_record(struct udev_device *device)
printf("E: %s=%s\n",
udev_list_entry_get_name(list_entry),
udev_list_entry_get_value(list_entry));
-
printf("\n");
}