]> git.feebdaed.xyz Git - 0xmirror/systemd.git/commit
process-util: Use pidref_wait_for_terminate_and_check in pidref_safe_fork()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 18 Dec 2025 09:28:30 +0000 (10:28 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 20 Dec 2025 14:44:20 +0000 (15:44 +0100)
commit8c367868eeaa59e72ef8d5560bf0ae307ac3561a
tree3eda37e5e93037c65d3e21341bec6a7781898748
parenta1e5d7f865cfd157be26b11c62efe33dcaefc219
process-util: Use pidref_wait_for_terminate_and_check in pidref_safe_fork()

Note that we still have to block SIGCHLD so that
we can be certain the process is not reaped before
we get the pidfd to it. safe_fork() and friends are
used in libsystemd where we don't control how the
SIGCHLD signal is configured. Specifically, kernel
autoreaping could be enabled which is why we have
to block SIGCHLD until we get the pidfd so that the
kernel cannot autoreap the process before we get
the pidfd.
src/basic/process-util.c