autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fewer forks during shell detection


From: Eric Blake
Subject: Re: fewer forks during shell detection
Date: Tue, 11 Nov 2008 19:51:35 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.17) Gecko/20080914 Thunderbird/2.0.0.17 Mnenhy/0.7.5.666

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

According to Ralf Wildenhues on 11/11/2008 12:35 PM:
> I haven't found a shell that needs this subshell, but this:
> $ echo '...' | ./foo 2>/dev/null
> 
> causes this output from some bash versions:
> | bash: echo: write error: Broken pipe

But doesn't that only happen if ./foo exits prior to echo being able to
push all its output?  I guess if the shell can't handle the input, it will
exit early, but maybe we could write this as:

echo '...' | { ./foo 2>/dev/null; as_status=$?; cat >/dev/null;
 test $as_status = 0; }

so that there is something to consume all of the echo output?  But I don't
think we have to worry about this unless we get actual reports of a noisy
echo.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkaRLcACgkQ84KuGfSFAYCw6gCfZwIupGPQhGYzXdjxBdyls3MY
F2IAmwT/SA7w0sERYVBCgG3HdTDHpj20
=JwnQ
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]