---------- Forwarded message ---------- From: Karel Zak <[email protected]> Message-ID: <[email protected]> Date: Thu, 9 Oct 2014 14:21:23 +0200 Subject: Re: script from 2.25.1 may be broken (hangs)
On Thu, Oct 09, 2014 at 11:53:15AM +0100, Adam Sampson wrote: > Thorsten Glaser <[email protected]> writes: > > > $ script -qc './test.sh -v' </dev/null 2>&1 | tee log > > For me, this doesn't hang, but it does exit before test.sh is actually > finished. Here's a simpler example that does the same thing: > > $ cat simpler.sh > #!/bin/sh > echo one > sleep 2 > echo two > $ script -c './simpler.sh' > Script started, file is typescript > one > two > Script done, file is typescript > $ script -c './simpler.sh' </dev/null > Script started, file is typescript > one > Script done, file is typescript > > The "wait for children" code at the end of doinput looks suspicious to > me -- finish() doesn't actually block, as the comment implies, just hmm.. because WNOHANG, it seems we need a one function for signal handler (with WNOHANG) and another function for the real program termination (without WNOHANG). Karel -- Karel Zak <[email protected]> http://karelzak.blogspot.com -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

