From: Yu Watanabe Date: Sun, 25 Nov 2018 05:52:24 +0000 (+0900) Subject: sd-device: do not call device_monitor_enable_receiving() for passed fd from pid1 X-Git-Tag: v240~218^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=916707cca56ac73c81d10c41b6d7f0800663fc29;p=thirdparty%2Fsystemd.git sd-device: do not call device_monitor_enable_receiving() for passed fd from pid1 Before c4b69e990f962128cc6975e36e91e9ad838fa2c4, if the socket fd is passed from pid1, `udev_monitor_enable_receiving()` (now it is a wrapper of `device_monitor_enable_receiving`) was not called. Let's preserve the original logic. Fixes #10754. --- diff --git a/src/libsystemd/sd-device/device-monitor.c b/src/libsystemd/sd-device/device-monitor.c index ff0fdbc93e3..8f2eec1bda7 100644 --- a/src/libsystemd/sd-device/device-monitor.c +++ b/src/libsystemd/sd-device/device-monitor.c @@ -210,9 +210,11 @@ _public_ int sd_device_monitor_start(sd_device_monitor *m, sd_device_monitor_han return r; } - r = device_monitor_enable_receiving(m); - if (r < 0) - return r; + if (!m->bound) { + r = device_monitor_enable_receiving(m); + if (r < 0) + return r; + } m->callback = callback; m->userdata = userdata;