When a worker receives both a signal and a udev event in the same epoll_wait
run, the event must be processed first because the udev parent considers the
event already dispatched. If we process the signal first and exit, udevd
times out after 60 seconds waiting for a response from an already-dead
worker.
Ref: https://bugs.launchpad.net/bugs/818177
Signed-off-by: Steve Langasek <steve.langasek@canonical.com>
for (i = 0; i < fdcount; i++) {
if (ev[i].data.fd == fd_monitor && ev[i].events & EPOLLIN) {
dev = udev_monitor_receive_device(worker_monitor);
+ break;
} else if (ev[i].data.fd == fd_signal && ev[i].events & EPOLLIN) {
struct signalfd_siginfo fdsi;
ssize_t size;