1
0
mirror of https://git.savannah.gnu.org/git/coreutils.git synced 2026-10-24 02:08:57 +03:00

timeout: don't fail to build with non-Linux prctl implementations

Linux 2.1.57 introduced both prctl(2) and PR_SET_PDEATHSIG(2), so the
condition before this patch is correct there. However, other systems
have a prctl function but not PR_SET_PDEATHSIG, e.g., Irix and
SerenityOS.

* src/timeout.c (main): Check that PR_SET_PDEATHSIG is defined before
using it.
This commit is contained in:
Collin Funk
2026-10-10 21:44:39 -07:00
parent 700d8235a3
commit 4e7ea3638c

View File

@@ -605,7 +605,7 @@ main (int argc, char **argv)
}
else if (monitored_pid == 0) /* child */
{
#if HAVE_PRCTL
#if HAVE_PRCTL && defined PR_SET_PDEATHSIG
/* Add protection if the parent dies without signaling child. */
prctl (PR_SET_PDEATHSIG, term_signal);
#endif