[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: yesno module consumes too much input
From: |
Eric Blake |
Subject: |
Re: yesno module consumes too much input |
Date: |
Sat, 18 Aug 2007 21:19:15 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Bruno Haible on 8/18/2007 5:12 PM:
>>
>> results in calling close_stdin first. From there, if close_stdin detects
>> an error, there is the potential for stdout/stderr to be unflushed (and
>> thus output data lost) when close_stdin calls _exit.
>
> I would just document that close_stdout and close_stdin are incompatible,
> and that close_stdin_stdout should be used instead of the two together.
But that brings us right back to where we are today without any patch -
close_stdin currently calls close_stdout in the correct timing, so an
application does either atexit(close_stdin) or atexit(close_stdout), but
not both.
> You can see that in coreutils, these functions are only used with atexit,
> at exactly one place in main(). The maintainer can statically determine
> whether he needs close_stdin or not, and if so, use close_stdin_stdout.
So maybe we are back to square one - leave yesno() alone (ie. it should
not install any atexit handler), and instead, document in yesno that any
caller should consider adding atexit(close_stdin) in main.
Affected programs (list might not be complete):
cp
find
install
ln
mv
rm
Jim, you are affected the most - which would you rather see, a relatively
big patch to yesno/closein that potentially changes API, or a one-line
patch to each of your five affected programs?
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGx7az84KuGfSFAYARAjWiAJ9tyW34vre2s6uz9IqctPXnhWglOwCgpebJ
F3gDXKciuiwj89tLlZkcAAE=
=3JSM
-----END PGP SIGNATURE-----
- Re: yesno module consumes too much input, (continued)
- Re: yesno module consumes too much input, Jim Meyering, 2007/08/17
- Re: yesno module consumes too much input, Paul Eggert, 2007/08/17
- Re: yesno module consumes too much input, Jim Meyering, 2007/08/17
- Re: yesno module consumes too much input, Eric Blake-1, 2007/08/17
- Re: yesno module consumes too much input, Paul Eggert, 2007/08/17
- Re: yesno module consumes too much input, Eric Blake, 2007/08/18
- Re: yesno module consumes too much input, Bruno Haible, 2007/08/18
- Re: yesno module consumes too much input, Eric Blake, 2007/08/18
- Re: yesno module consumes too much input, James Youngman, 2007/08/18
- Re: yesno module consumes too much input, Bruno Haible, 2007/08/18
- Re: yesno module consumes too much input,
Eric Blake <=
- Re: yesno module consumes too much input, Jim Meyering, 2007/08/19
- Re: yesno module consumes too much input, Eric Blake, 2007/08/19
- Re: yesno module consumes too much input, Jim Meyering, 2007/08/20
- Re: yesno module consumes too much input, Eric Blake, 2007/08/19
- Re: yesno module consumes too much input, Eric Blake, 2007/08/18
- Re: yesno module consumes too much input, Bruno Haible, 2007/08/18
- Re: yesno module consumes too much input, Eric Blake, 2007/08/18
- new module finpending (was: Re: yesno module consumes too much input), Bruno Haible, 2007/08/18
- Re: new module finpending, Jim Meyering, 2007/08/19
- Re: new module finpending, Bruno Haible, 2007/08/19