summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipe Brandenburger <filbranden@google.com>2018-07-20 20:32:55 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-07-21 16:40:08 +0200
commit46f2579c2ac9f6780d5afec1000764defc6b581e (patch)
tree8af32066e9b715a0fea1bc25ccabf7d8422c68bd
parentFix grammar (diff)
downloadsystemd-46f2579c2ac9f6780d5afec1000764defc6b581e.tar.xz
systemd-46f2579c2ac9f6780d5afec1000764defc6b581e.zip
systemctl: Only wait when there's something to wait for.
Tested: - `systemctl --wait start i-do-not-exist.service` does not wait. - `systemctl --wait start i-do-not-exist.service valid-unit.service` does.
-rw-r--r--src/systemctl/systemctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 6f8934eef0..d9bef997d5 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -3149,7 +3149,7 @@ static int start_unit(int argc, char *argv[], void *userdata) {
(void) check_triggering_units(bus, *name);
}
- if (r >= 0 && arg_wait) {
+ if (r >= 0 && arg_wait && !set_isempty(wait_context.unit_paths)) {
int q;
q = sd_event_loop(wait_context.event);
if (q < 0)