diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-01-26 00:33:08 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-02-20 06:17:42 +0900 |
commit | 78467aeb9578bee56211a64190b3293616647aee (patch) | |
tree | 8443430783fc04e4f606fba37e298bfeb57deee6 /src/udev/udevadm-trigger.c | |
parent | a0b60b8a1b16217d9167d03c1c0ee7e4a362514f (diff) | |
download | systemd-78467aeb9578bee56211a64190b3293616647aee.tar.gz systemd-78467aeb9578bee56211a64190b3293616647aee.tar.bz2 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.c | 6 |
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++) { |