summaryrefslogtreecommitdiffstats
path: root/src/udev/udevadm-trigger.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-01-25 16:33:08 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-02-19 22:17:42 +0100
commit78467aeb9578bee56211a64190b3293616647aee (patch)
tree8443430783fc04e4f606fba37e298bfeb57deee6 /src/udev/udevadm-trigger.c
parentudevadm: print error if the commands fail (diff)
downloadsystemd-78467aeb9578bee56211a64190b3293616647aee.tar.xz
systemd-78467aeb9578bee56211a64190b3293616647aee.zip
udev-ctrl: split out logic of waiting for reply to udev_ctrl_wait()
This makes `udevadm control` can send multiple commands in one connection.
Diffstat (limited to 'src/udev/udevadm-trigger.c')
-rw-r--r--src/udev/udevadm-trigger.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/udev/udevadm-trigger.c b/src/udev/udevadm-trigger.c
index 14c70e4009..63ceaaf957 100644
--- a/src/udev/udevadm-trigger.c
+++ b/src/udev/udevadm-trigger.c
@@ -312,9 +312,13 @@ int trigger_main(int argc, char *argv[], void *userdata) {
if (r < 0)
return log_error_errno(r, "Failed to initialize udev control: %m");
- r = udev_ctrl_send_ping(uctrl, ping_timeout_usec);
+ r = udev_ctrl_send_ping(uctrl);
if (r < 0)
return log_error_errno(r, "Failed to connect to udev daemon: %m");
+
+ r = udev_ctrl_wait(uctrl, ping_timeout_usec);
+ if (r < 0)
+ return log_error_errno(r, "Failed to wait for daemon to reply: %m");
}
for (; optind < argc; optind++) {