mirror of
https://github.com/systemd/systemd.git
synced 2026-11-06 05:17:24 +00:00
systemctl-clean-or-freeze: do not wait for units with --no-block
If --no-block is specified, the waiter is not allocated. But bus_wait_for_units_run() was called unconditionally, and it asserts that its argument is not NULL. Only wait for the units when the waiter is allocated, as verb_kill() does.
This commit is contained in:
1 parent
07dbaa6ab0
commit
893d9cfb50
1 file changed
+7
-5
@@ -95,11 +95,13 @@ int verb_clean_or_freeze(int argc, char *argv[], uintptr_t _data, void *userdata
|
||||
}
|
||||
}
|
||||
|
||||
r = bus_wait_for_units_run(w);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to wait for units: %m");
|
||||
if (r == BUS_WAIT_FAILURE)
|
||||
ret = EXIT_FAILURE;
|
||||
if (w) {
|
||||
r = bus_wait_for_units_run(w);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to wait for units: %m");
|
||||
if (r == BUS_WAIT_FAILURE)
|
||||
ret = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
Reference in new issue
Block a user