- if (gettimeofday(&tv, &tz) == 0) {
- snprintf(timestr, sizeof(timestr), "%llu.%06u",
- (unsigned long long) tv.tv_sec, (unsigned int) tv.tv_usec);
- } else
- timestr[0] = '\0';
-
- if ((kernel_monitor != NULL) && FD_ISSET(udev_monitor_get_fd(kernel_monitor), &readfds)) {
- struct udev_device *device = udev_monitor_receive_device(kernel_monitor);
- if (device == NULL)
- continue;
- printf("UEVENT[%s] %-8s %s (%s)\n", timestr,
- udev_device_get_action(device),
- udev_device_get_devpath(device),
- udev_device_get_subsystem(device));
- if (env) {
- struct udev_list *list;
-
- list = udev_device_get_properties_list(device);
- while (list != NULL) {
- printf("%s=%s\n", udev_list_entry_get_name(list), udev_list_entry_get_value(list));
- list = udev_list_entry_get_next(list);
- }
- printf("\n");
- }
- udev_device_unref(device);
- }
+ for (i = 0; i < fdcount; i++) {
+ if (ev[i].data.fd == fd_kernel && ev[i].events & EPOLLIN) {
+ struct udev_device *device;