util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Adam Sampson <ats@offog.org>
Cc: Thorsten Glaser <tg@mirbsd.org>, util-linux@vger.kernel.org
Subject: Re: script from 2.25.1 may be broken (hangs)
Date: Thu, 9 Oct 2014 14:21:23 +0200	[thread overview]
Message-ID: <20141009122123.GG8057@x2.net.home> (raw)
In-Reply-To: <y2a7g09a50k.fsf@cartman.at.offog.org>

On Thu, Oct 09, 2014 at 11:53:15AM +0100, Adam Sampson wrote:
> Thorsten Glaser <tg@mirbsd.org> 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  <kzak@redhat.com>
 http://karelzak.blogspot.com

  reply	other threads:[~2014-10-09 12:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-08 22:25 script from 2.25.1 may be broken (hangs) Thorsten Glaser
2014-10-09 10:53 ` Adam Sampson
2014-10-09 12:21   ` Karel Zak [this message]
2014-10-09 13:25     ` Fwd: " Thorsten Glaser
2014-10-14 10:12       ` Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141009122123.GG8057@x2.net.home \
    --to=kzak@redhat.com \
    --cc=ats@offog.org \
    --cc=tg@mirbsd.org \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).