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.
---
 src/timeout.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/timeout.c b/src/timeout.c
index 94d2c41cb..34a2b82c4 100644
--- a/src/timeout.c
+++ b/src/timeout.c
@@ -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
-- 
2.56.0


Reply via email to