[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: proposed change to close-stream module
From: |
Jim Meyering |
Subject: |
Re: proposed change to close-stream module |
Date: |
Fri, 29 Sep 2006 17:42:14 +0200 |
Bruno Haible <address@hidden> wrote:
> Hi Paul and Jim,
>
> It bothers me that in order to implement a basic functionality like the
> 'closeout' module, you need the __fpending module, which is not based on
> POSIX but rather a case-by-case hack for various platforms.
>
> Here is a proposed patch to lift this dependency. Instead of using
> __fpending, the code in fwriteerror.c looks at the return code of
> fflush. The idea is that if the stream's output buffer is nonempty
> and fd=1 is an invalid file descriptor, fflush(stdout) must yield an
> EBADF error.
>
> 2006-09-29 Bruno Haible <address@hidden>
>
> * modules/close-stream (Depends-on): Add fwriterror. Remove fpending,
> stdbool.
> * lib/close-stream.c: Include fwriteerror.h. Don't include
> errno.h, stdbool.h, __fpending.h, unlocked-io.h.
> (close_stream): Call fwriteerror_no_ebadf.
This looks potentially disruptive.
Have you tested it much?
I hope you can wait a little while for this one, too.