sd-device: do not call device_monitor_enable_receiving() for passed fd from pid1

Before c4b69e990f, 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.
This commit is contained in:
Yu Watanabe 2018-11-25 14:52:24 +09:00
parent f1d7b7874e
commit 916707cca5
1 changed files with 5 additions and 3 deletions

View File

@ -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;