chiark / gitweb /
move udev_ctrl to libudev-private
[elogind.git] / udev / lib / test-libudev.c
index 3c38600192150e8e3d1b448596afe7e5ff488496..835536af84645d75b3d312d85f6cc7517d10793b 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_syspath(device);
+       printf("syspath:   '%s'\n", str);
        str = udev_device_get_devname(device);
        printf("devname:   '%s'\n", str);
        count = udev_device_get_devlinks(device, print_devlinks_cb, NULL);
@@ -110,6 +112,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);
@@ -126,7 +132,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;