Pierre,

The existing write_error() function prints an error, removes the output
file and exits with an error code.  So I believe that my patch is
equivalent to what you are suggesting (except you have some unreachable
code :)).

Matt


On Sat, Jun 03, 2006 at 12:29:37PM +0200, Pierre HABOUZIT wrote:
> 
>   I personnaly disagree with the attached patch.
>   I'd have proposed more something that does:
> 
>     if (!to_stdout) {
>       /* Copy modes, times, ownership, and remove the input file */
>       copy_stat(&istat);
>       /* if close fails (e.g. over quota !) destroy output file, and fail 
> hard */
>       if (close(ofd)) {
>           write_error();
>           xunlink(ofname);
>           WARN((stderr, "%s: ", progname));
>           abort();
>       }
>     }
> 
>   of course, I don't have gzip sources under the eye, but that do seem more
> robust to me and more in the unix spirit (if anything fails, go in the
> previous state back, and fail noisily).
> 
> 
> -- 
> ·O·  Pierre Habouzit
> ··O                                                [EMAIL PROTECTED]
> OOO                                                http://www.madism.org




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to