chiark / gitweb /
libudev: rename enumerate function
[elogind.git] / udev / lib / test-libudev.c
index d0095f15fc5828cc9cab1a1971b671be93eb678f..1e9469d1c52b83388e7576a7de70745940dc85fc 100644 (file)
@@ -58,6 +58,8 @@ static void print_device(struct udev_device *device)
        printf("devpath:   '%s'\n", str);
        str = udev_device_get_subsystem(device);
        printf("subsystem: '%s'\n", str);
+       str = udev_device_get_driver(device);
+       printf("driver:    '%s'\n", str);
        str = udev_device_get_syspath(device);
        printf("syspath:   '%s'\n", str);
        str = udev_device_get_devname(device);
@@ -96,7 +98,7 @@ static int test_enumerate(struct udev *udev, const char *subsystem)
 {
        int count;
 
-       count = udev_devices_enumerate(udev, subsystem, devices_enum_cb, NULL);
+       count = udev_enumerate_devices(udev, subsystem, devices_enum_cb, NULL);
        printf("found %i devices\n\n", count);
        return count;
 }
@@ -112,6 +114,10 @@ static int test_monitor(struct udev *udev, const char *socket_path)
                printf("no socket\n");
                return -1;
        }
+       if (udev_monitor_enable_receiving(udev_monitor) < 0) {
+               printf("bind failed\n");
+               return -1;
+       }
 
        fd = udev_monitor_get_fd(udev_monitor);
        FD_ZERO(&readfds);
@@ -128,7 +134,7 @@ static int test_monitor(struct udev *udev, const char *socket_path)
                printf("select fd count: %i\n", fdcount);
 
                if (FD_ISSET(fd, &readfds)) {
-                       device = udev_monitor_get_device(udev_monitor);
+                       device = udev_monitor_receive_device(udev_monitor);
                        if (device == NULL) {
                                printf("no device from socket\n");
                                continue;