udev: open control and netlink sockets before daemonization
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 8 Jan 2019 21:41:16 +0000 (22:41 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 10 Jan 2019 05:09:15 +0000 (14:09 +0900)
commitb5af8c8cdf5fc7cc5d4108460270728375eb7fc4
tree07c75f600f62659ce288e78f880e9dc840121e71
parent44dcf454b604628bf451194482c97ce981596ce5
udev: open control and netlink sockets before daemonization

c4b69e990f962128cc6975e36e91e9ad838fa2c4 effectively moved the initalization of socket.
Before that commit:
run → listen_fds → udev_ctrl_new → udev_ctrl_new_from_fd → socket()
After:
run → main_loop → manager_new → udev_ctrl_new_from_fd → socket()

The problem is that main_loop was called after daemonization. Move manager_new
out of main_loop and before daemonization.

Fixes #11314 (hopefully ;)).

v2: Yu Watanabe
sd_event is initialized in main_loop().
src/udev/udevd.c