[Top][All Lists]

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

Re: [PATCHv2 0/7] Re: temp file suffixes: mktemp DWIM

From: Eric Blake
Subject: Re: [PATCHv2 0/7] Re: temp file suffixes: mktemp DWIM
Date: Thu, 5 Nov 2009 15:56:41 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Jim Meyering <jim <at> meyering.net> writes:

> -      if (!dry_run && close_stream (stdout))
> +      if (!dry_run && (ferror (stdout) || fflush (stdout) != 0))

That means #include "close-stream.h" is no longer required.  Also, should we 
try the fflush before ferror?

On the other hand, aren't there situations with NFS where fflush() will succeed 
at getting the data into a kernel buffer, but fclose() then fails because the 
kernel was unable to flush its buffers over the network?  Maybe we have to do 
something like dd, where we keep this location calling close_stream after all, 
then use a custom atexit() hook that decides whether to call close_stdout() or 
just manually handle only stderr?

Eric Blake

reply via email to

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