]> git.ipfire.org Git - thirdparty/systemd.git/commit
systemctl: fix continue placement in clean-or-freeze error handling 42744/head
authordongshengyuan <545258830@qq.com>
Thu, 25 Jun 2026 08:40:28 +0000 (16:40 +0800)
committerdongshengyuan <545258830@qq.com>
Thu, 25 Jun 2026 08:40:28 +0000 (16:40 +0800)
commit68b59ca74fc53e1f2115d6e35244f350c7336ef5
tree9e2e3a483d414a62acb215b115a27461e97610bf
parent3daf3e19dad83495e32a6656f851b8caf112ce4f
systemctl: fix continue placement in clean-or-freeze error handling

When sd_bus_call() fails, the continue was inside the
'if (ret == EXIT_SUCCESS)' guard, so only the first failure skipped
adding the unit to the job waiter. On the second and subsequent
failures, the unit was still passed to bus_wait_for_units_add_unit()
despite no job being started, causing bus_wait_for_units_run() to
hang indefinitely.

Move continue outside the guard so any failure skips the waiter
registration. The guard still prevents ret from being overwritten by
a later error code.

Signed-off-by: dongshengyuan <dongshengyuan@uniontech.com>
src/systemctl/systemctl-clean-or-freeze.c