udev_list_node_remove(&event->node);
/* mark as failed, if "add" event returns non-zero */
- if (event->exitcode != 0 && strcmp(udev_device_get_action(event->dev), "add") == 0)
+ if (event->exitcode != 0 && strcmp(udev_device_get_action(event->dev), "remove") != 0)
udev_queue_export_device_failed(udev_queue_export, event->dev);
else
udev_queue_export_device_finished(udev_queue_export, event->dev);
}
}
-static void event_run(struct event *event)
+static void event_run(struct event *event, bool force)
{
struct udev_list_node *loop;
return;
}
- if (childs >= max_childs) {
+ if (!force && childs >= max_childs) {
info(event->udev, "maximum number (%i) of childs reached\n", childs);
return;
}
/* run all events with a timeout set immediately */
if (udev_device_get_timeout(dev) > 0) {
- worker_new(event);
+ event_run(event, true);
return;
}
}
continue;
}
- event_run(event);
+ event_run(event, false);
}
}
if (udev_get_rules_path(udev) != NULL) {
inotify_add_watch(pfd[FD_INOTIFY].fd, udev_get_rules_path(udev),
- IN_CREATE | IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
+ IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
} else {
char filename[UTIL_PATH_SIZE];
struct stat statbuf;
inotify_add_watch(pfd[FD_INOTIFY].fd, LIBEXECDIR "/rules.d",
- IN_CREATE | IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
+ IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
inotify_add_watch(pfd[FD_INOTIFY].fd, SYSCONFDIR "/udev/rules.d",
- IN_CREATE | IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
+ IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
/* watch dynamic rules directory */
util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/rules.d", NULL);
udev_selinux_resetfscreatecon(udev);
}
inotify_add_watch(pfd[FD_INOTIFY].fd, filename,
- IN_CREATE | IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
+ IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
}
udev_watch_restore(udev);