1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 18:55:40 +03:00

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.
This commit is contained in:
Filipe Brandenburger 2018-07-20 11:32:55 -07:00 committed by Yu Watanabe
parent bc21034688
commit 46f2579c2a

View 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)