[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-dejagnu] close_wait_program, process groups and kill /bin/sh bu
From: |
Ben Elliston |
Subject: |
Re: [Bug-dejagnu] close_wait_program, process groups and kill /bin/sh builtin |
Date: |
Fri, 6 Jul 2018 21:33:59 +1000 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
On Fri, Jul 06, 2018 at 10:12:50AM +0200, Richard Biener wrote:
> Andreas Schwab rightfully points out that the test
>
> if { $pid > 0 } {
>
> looks odd as well thus the whole close_wait_program function doesn't
> seem to expect multiple PIDs. The above is probably to catch
>
> # If we didn't get EOF, we have to kill the poor defenseless program.
> if { $got_eof } {
> set pid -1
> }
>
> so it might work depending on what 12 234 > 0 semantically means
> for TCL... That said, without touching the above test the following
> approach makes sure to not rely on any particular behavior for
> multi-process kills.
In this context, $pid > 0 is a lexographic greater-than test of $pid
with "0". eg:
% if {"1 2 3" > 1} { puts ok }
ok
% if {"1 2 3" > "1 2"} { puts ok }
ok
% if {"1 2 3" > "1 2 3"} { puts ok }
%
> I've verified it works for my case and I ran make check with the
> patch on the git head where all tests passed.
Thanks.
Ben
signature.asc
Description: PGP signature