HomeFreeBSD

init: fix shutdown race

Description

init: fix shutdown race

When calling shutdown, shutdown sends a signal to init and exits. This
causes a race condition for the waitpid function. If the signal wins the
race, wpid will be set to -1 and init calls death_single. If shutdown
wins the race, wpid will be set to the pid of the shutdown process and
the requested_transition will be ignored.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36356
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 203f2c14c4b3c7a3e8f51a5a248201e1eb091886)

Details

Provenance
corvinkAuthored on Sep 6 2022, 7:06 AM
Reviewer
imp
Differential Revision
D36356: init: fix shutdown race
Parents
rG5b6f0a5012e9: libc: remove unneeded sys/types.h include from several synopses
Branches
Unknown
Tags
Unknown