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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user