[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#9098: timeout should use waitpid
From: |
Pádraig Brady |
Subject: |
bug#9098: timeout should use waitpid |
Date: |
Sat, 16 Jul 2011 14:15:25 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 |
On 16/07/11 13:17, Andreas Schwab wrote:
> timeout assumes that it only has to wait for a single child. But this
> is not true, it can always inherit other children from its predecessor:
>
> $ sh -c "sleep 1 & exec timeout 2 sh -c 'sleep 3; echo foo'"
>
> This will echo foo after three seconds, although the inner shell is
> supposed to be killed after two seconds.
>
> Andreas.
>
>>From 331a32b8bbe3cc07d5522004e90fba2bde20a1c3 Mon Sep 17 00:00:00 2001
> From: Andreas Schwab <address@hidden>
> Date: Sat, 16 Jul 2011 13:51:06 +0200
> Subject: [PATCH] timeout: ignore inherited children
>
> * src/timeout.c (main): Use waitpid instead of wait.
Thanks for that.
Also gnulib seems to support waitpid on mingw but not wait.
So I'll apply this.
thanks,
Pádraig.