bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Replacement for the sigs_to_ignore hack in timeout.c


From: Bruce Korb
Subject: Re: [PATCH] Replacement for the sigs_to_ignore hack in timeout.c
Date: Sat, 28 Feb 2009 09:09:31 -0800
User-agent: Thunderbird 2.0.0.19 (X11/20081227)

Hey, I remember this!  There was a long discussion about
SIGCHLD vs. SIGCLD / SysVR4 vs. BSD on the Austin reflector.
"implementations" are now allowed to reset the handler to
SIG_DFL on exec(2), so it is "may not work" not "will not work".
Anyway, the final answer is that all programs that want
their zombies reaped should set the handler to a no-op
function at startup time.  Never use SIG_IGN for SIGCHLD,
period.  At all.  SIG_IGN will always be "allowed" to propagate
to exec-ed processes yielding bad results.  :(

Bruno Haible wrote:
> Jim Meyering wrote:
>>> the change I could apply is to add a comment in the specification:
>>> "This function assumes that the signal handler for SIGCHLD is not set to
>>> SIG_IGN."

> @@ -50,7 +50,9 @@
>       with an error status.
>     - If termsigp is not NULL, *termsig will be set to the signal that
>       terminated the subprocess (if supported by the platform: not on native
> -     Windows platforms), otherwise 0.  */
> +     Windows platforms), otherwise 0.
> +   Prerequisites: The signal handler for SIGCHLD should not be set to 
> SIG_IGN,
> +   otherwise this function will not work.  */
>  extern int wait_subprocess (pid_t child, const char *progname,
>                           bool ignore_sigpipe, bool null_stderr,
>                           bool slave_process, bool exit_on_error,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]