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: Jim Meyering
Subject: Re: [Bug-gnulib] closeout doesn't always close: which is better: always or never?
Date: Sat, 06 Nov 2004 18:05:43 +0100

Bruno Haible <address@hidden> wrote:
> 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.

Hi Bruno,

Thanks, but I wasn't worried about portability or efficiency.
Rather, I think that the function name is misleading.
Is there any reason to call fclose rather than just fflush?




reply via email to

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