X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fudev%2Fudevd.c;h=a7f8cbdf5b91cc0d35332f3b1be5526df16e466e;hb=b5338a19864ac3f5632aee48069a669479621dca;hp=b75145eebfbbcfaca30e5a41db8e8ad62798557a;hpb=9ec6e95b046de71c0198cb9d17acc5462dc76c74;p=elogind.git diff --git a/src/udev/udevd.c b/src/udev/udevd.c index b75145eeb..a7f8cbdf5 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -48,6 +48,7 @@ #include "udev.h" #include "udev-util.h" +#include "rtnl-util.h" #include "sd-daemon.h" #include "cgroup-util.h" #include "dev-setup.h" @@ -73,7 +74,7 @@ static bool reload; static int children; static int children_max; static int exec_delay; -static usec_t event_timeout_usec = 30 * USEC_PER_SEC; +static usec_t event_timeout_usec = 180 * USEC_PER_SEC; static sigset_t sigmask_orig; static UDEV_LIST(event_list); static UDEV_LIST(worker_list); @@ -100,9 +101,6 @@ struct event { dev_t devnum; int ifindex; bool is_block; -#ifdef HAVE_FIRMWARE - bool nodelay; -#endif }; static inline struct event *node_to_event(struct udev_list_node *node) { @@ -203,6 +201,7 @@ static void worker_new(struct event *event) { case 0: { struct udev_device *dev = NULL; int fd_monitor; + _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL; struct epoll_event ep_signal, ep_monitor; sigset_t mask; int rc = EXIT_SUCCESS; @@ -304,11 +303,17 @@ static void worker_new(struct event *event) { } } + /* needed for renaming netifs */ + udev_event->rtnl = rtnl; + /* apply rules, create node, symlinks */ udev_event_execute_rules(udev_event, event_timeout_usec, rules, &sigmask_orig); udev_event_execute_run(udev_event, event_timeout_usec, &sigmask_orig); + /* in case rtnl was initialized */ + rtnl = sd_rtnl_ref(udev_event->rtnl); + /* apply/restore inotify watch */ if (udev_event->inotify_watch) { udev_watch_begin(udev, dev); @@ -458,10 +463,6 @@ static int event_queue_insert(struct udev_device *dev) { event->devnum = udev_device_get_devnum(dev); event->is_block = streq("block", udev_device_get_subsystem(dev)); event->ifindex = udev_device_get_ifindex(dev); -#ifdef HAVE_FIRMWARE - if (streq(udev_device_get_subsystem(dev), "firmware")) - event->nodelay = true; -#endif log_debug("seq %llu queued, '%s' '%s'", udev_device_get_seqnum(dev), udev_device_get_action(dev), udev_device_get_subsystem(dev)); @@ -538,12 +539,6 @@ static bool is_devpath_busy(struct event *event) { return true; } -#ifdef HAVE_FIRMWARE - /* allow to bypass the dependency tracking */ - if (event->nodelay) - continue; -#endif - /* parent device event found */ if (event->devpath[common] == '/') { event->delaying_seqnum = loop_event->seqnum; @@ -956,7 +951,7 @@ static int systemd_fds(struct udev *udev, int *rctrl, int *rnetlink) { */ static void kernel_cmdline_options(struct udev *udev) { _cleanup_free_ char *line = NULL; - char *w, *state; + const char *word, *state; size_t l; int r; @@ -966,10 +961,10 @@ static void kernel_cmdline_options(struct udev *udev) { if (r <= 0) return; - FOREACH_WORD_QUOTED(w, l, line, state) { + FOREACH_WORD_QUOTED(word, l, line, state) { char *s, *opt; - s = strndup(w, l); + s = strndup(word, l); if (!s) break; @@ -1205,7 +1200,7 @@ int main(int argc, char *argv[]) { sd_notify(1, "READY=1"); } - print_kmsg("starting version " VERSION "\n"); + log_info("starting version " VERSION "\n"); if (!debug) { int fd;