bug-gnulib
[Top][All Lists]
Advanced

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

Re: [Bug-gnulib] closeout doesn't always close: which is better: always


From: Bruno Haible
Subject: Re: [Bug-gnulib] closeout doesn't always close: which is better: always or never?
Date: Sat, 6 Nov 2004 17:22:01 +0100
User-agent: KMail/1.5

Jim Meyering wrote:
>   Which is better: to close all of the time, or never?

From the point of view of minimizing system calls, the code is good as it is:
the extra close(1) is performed only when writing to a non-interactive
output stream, not when libc has provided an unbuffered stdout. You can
rename it to close_stdout_if_closing_later_could_fail(). :-)

There is no portability issue, because on those platforms for which
__fpending is not yet ported, it will return 1, which is on the safe side.

Bruno





reply via email to

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