From 916707cca56ac73c81d10c41b6d7f0800663fc29 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sun, 25 Nov 2018 14:52:24 +0900 Subject: [PATCH] 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. --- src/libsystemd/sd-device/device-monitor.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libsystemd/sd-device/device-monitor.c b/src/libsystemd/sd-device/device-monitor.c index ff0fdbc93e..8f2eec1bda 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;