]> git.ipfire.org Git - thirdparty/systemd.git/commit
manager: fix error handling after failure to set up child 28758/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 10 Aug 2023 08:59:55 +0000 (10:59 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 16 Aug 2023 10:52:56 +0000 (12:52 +0200)
commit5fa01ac0369f0f225ab1e1f90f6b7058cc4deaaf
tree5c7365f73f184e033a7eda641fcc1e92a2811fac
parent7ab24710a67ab56a26a92e0bce23205298606125
manager: fix error handling after failure to set up child

exec_child() is supposed to set *exit_status when returning failure.
Unfortunately, we didn't do that in two cases. The result would be:
- a bogus error message "Failed at step SUCCESS spawning foo: …",
- a bogus success exit status.

Bugs introduced in 390902012c5177b6b01bc634b2e9c704073d9e7d and
ad21e542b20f0fb292d1958d3a759bf3403522c2.

The code is reworked to add some asserts and not set exit_status in the caller
so that it's clearer (also to the compiler) that it needs to be set.
src/core/execute.c