Re: script input redirection / eof handling

Phillip Susi
2013-12-02T14:45:19Z

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/2/2013 7:54 AM, Karel Zak wrote:
> Note, that if you want to support this scenario (stdin is not a
> terminal) then send a patch ;-)

It seems to work fine up until it hits eof, which can also happen on a
tty and you'll get the same bad behavior, so I think refusing to run
on a non tty isn't a proper fix.

>> Yep, I think it would be enough to add
>>
>> kill(0, SIGTERM);
>>
>> before done() in doinput() to avoid orphans.

You don't want to just make sure the children die, you want to make
sure that the child sees the eof and capture any final output it may have.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSnJz9AAoJEI5FoCIzSKrw6j0IAKZvkym0kJQfWghombuTnV1z
5FCcWPz3Jyo9V96X+fnD3cXpkkPjIM5ZUIBaRJubUYX65AKebXaXw+FkE9YyXsIR
Jeegewp5IlSlF3zbZzCSUchI/gK0KCHv1yKe21xD20iGAy9MGApXBJszsOaREbU2
nG9mFYwviFDQnURBfwHxvS7Bf4S+6i1wgKeS58EqSeXpMpMDCimTw1/mv8MLnGdS
0nzCrPZvgRZcc2avYPSWYs8ZLtFgu5rDuJ7J9TfEuiEzGWCqlPXQYF1a6nHvpT0W
KSdu+1bzsasdrEXFF6Iai2NvFndg9JXqiLCGfKdELbJayYPjwltOtl41PfalG/w=
=2lT4
-----END PGP SIGNATURE-----