chiark / gitweb /
libudev: get devnum from uevent file
[elogind.git] / udev / lib / test-libudev.c
index fed4350c0908f41cf7f9999d97f9ca98da706942..421d0511a122e2d2361b974dee773847bbc301e5 100644 (file)
@@ -40,6 +40,7 @@ static void log_fn(struct udev *udev,
 static void print_device(struct udev_device *device)
 {
        const char *str;
+       dev_t devnum;
        int count;
        struct udev_list *list;
 
@@ -56,6 +57,8 @@ static void print_device(struct udev_device *device)
        printf("driver:    '%s'\n", str);
        str = udev_device_get_devnode(device);
        printf("devname:   '%s'\n", str);
+       devnum = udev_device_get_devnum(device);
+       printf("devnum:    %u:%u\n", major(devnum), minor(devnum));
 
        count = 0;
        list = udev_device_get_devlinks_list(device);