]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: Only wait when there's something to wait for.
authorFilipe Brandenburger <filbranden@google.com>
Fri, 20 Jul 2018 18:32:55 +0000 (11:32 -0700)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 21 Jul 2018 14:40:08 +0000 (23:40 +0900)
Tested:
- `systemctl --wait start i-do-not-exist.service` does not wait.
- `systemctl --wait start i-do-not-exist.service valid-unit.service` does.

src/systemctl/systemctl.c

index 6f8934eef08b7b6c22765e14fcf37a3bd65a5b26..d9bef997d593412fdabbb33c1e1016c75ae59089 100644 (file)
@@ -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)