Re: close_wait_program, process groups and kill /bin/sh builtin

Ben Elliston <[email protected]> Fri, 6 Jul 2018 21:33:59 +1000
Newsgroups gmane.comp.sysutils.dejagnu.bugs
Message-ID <[email protected]>
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

_______________________________________________
Bug-dejagnu mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-dejagnu
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEFS8+rdM1/2KWERKFZ9rcPj90NkkFAls/U6YACgkQZ9rcPj90
NkkXvhAArByNfHAuSygyLy1Ks1ffcrB2v0ibu43twn+18OMC3iWJp8UzCo6Lr3c4
6VIjr/aslGPuc2F29MC7ZeNmI/Fd5inEfCQsn+b3ZN4U7awYDei84znV9nibbkpL
3BCk9VQvu6+XeviAlyV3GiVz6r3TgIzbQoBdxpgkgYJldTfYMMyNlOfy/F7RDhdd
RMdOopGSxbUr/PEAXN4Xozp9kdH3AdyYNkd54ch5b/jiI/Nm2F3mRhjT4YydgLkO
9hGt+eHDnCHotnmWq1nmdgw/CWmBujYHbi4ZxBYLe40aPlqlT9XttEl+CdVrg7mh
BAxi72dEPtBz6qnkncMxonHItncCoDg9Y+E9058CkX9bBQIdT7FlKNP54X2YQBoA
sewXQ/zVe1G8hzQFQKDyyXFcKMxxY2OxsUBTRRveQpDy6ipp/4cJ6ajZtR5BUOKk
34RIquuSudpaWSYnbk7SK7kuGWpclHEcmKRvpzrh7bjOe2D4opI3ZnBg6M7mont0
Ghhi5OGK/IVumnvZjeR9XAUn6325epMAe7kMzQxat/IYd5Y/EeTawwEz9INZKI4X
irV+rOwnc+3ojdAg0/WPCKVecEPkYNrxxWUlQlqqIEGrgP/pgw3BTKmDDHoIHgKr
BVmSAJOz5pi3IjY2MV4hlyKW01V4AqWAyp3CGrpg0l19gDtQyNc=
=7u+T
-----END PGP SIGNATURE-----