Re: 'cat' doesn't check close(STDOUT_FILENO)'s return value
From:
Jim Meyering
Subject:
Re: 'cat' doesn't check close(STDOUT_FILENO)'s return value
Date:
Wed, 14 Dec 2005 08:58:20 +0100
Paul Eggert <address@hidden> wrote:
> On some operating systems, notices of output errors are sometimes
> delayed until you close the file. However, in the normal case
> coreutils 'cat' doesn't check the return value from
> 'close(STDOUT_FILENO)'. I installed this patch.
>
> 2005-12-13 Paul Eggert <address@hidden>
>
> * src/cat.c (main): Check for close (STDOUT_FILENO) failure.
Thanks, but why is that needed?
I was convinced that the existing `atexit (close_stdout)' covered all
the bases, since close_stdout calls `fclose (stdout)' unconditionally,
and that does the equivalent of `close (STDOUT_FILENO)'.