bug-make
[Top][All Lists]
Advanced

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

Re: [bug #33134] spurious error when stdout is already closed


From: David Boyce
Subject: Re: [bug #33134] spurious error when stdout is already closed
Date: Thu, 21 Apr 2011 00:31:54 -0400

On Thu, Apr 21, 2011 at 12:00 AM, Philip Guenther <address@hidden> wrote:
> Why is that a mistake?
>
> It appears you're saying that make should complain about failures to
> write to stdout for reasons like EIO, ENOSPC,  and EOVERFLOW, but
> *not* for EBADF.

I think you're still not getting my point here. I do not believe this
has anything to do with *writes* at all, failed or otherwise. Make is
attempting to close something that's already closed and complaining
when it doesn't work. POSIX is quite clear that fclose on a closed
stream results in an error condition.

> (Actually, your patch doesn't just ignore EBADF errors: it ignores
> EPIPE errors, as the ftell() will fail on the pipe.  Why is that a
> good idea?)

You're right on this. An earlier version of my change, when it was
implemented within close_stdout(), looked something like

    if (ftell(stdout) == -1 && errno == EBADF) ...

but I lost the EBADF test when I redid it. That was a mistake, and
maybe there's a better way of checking for closure than ftell anyway,
but the basic point of not closing something unless it was open
remains.

David B



reply via email to

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