Subject: bug#9076: bug#9098: timeout should use waitpid

From: Jim Meyering <[email-masked]>
Date: Sun, 17 Jul 2011 11:44:23 +0200

Paul Eggert wrote:
...
> Subject: [PATCH 4/6] * src/timeout.c (main): Use waitpid, not wait
>  (Bug#9098).
>
> Reported by Andreas Schwab.
>
> * src/timeout.c (SA_RESTART): Define to 0 if not defined.
> ---
>  src/timeout.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/src/timeout.c b/src/timeout.c
> index 895d720..2d6dad8 100644
> --- a/src/timeout.c
> +++ b/src/timeout.c
> @@ -365,7 +365,8 @@ main (int argc, char **argv)
>
>        alarm (timeout);
>
> -      while ((wait_result = wait (&status)) < 0 && errno == EINTR)
> +      while ((wait_result = waitpid (monitored_pid, &status, 0)) < 0
> +             && errno == EINTR)

Thanks for doing that.
Since this fixes a bug, would you please add a note to NEWS and
add a test case to exercise the bug?