bugmake - Bugs: bug #33134, spurious error when stdout is...

 
 

bug #33134: spurious error when stdout is already closed

Submitter:  David Boyce <boyski>
Submitted:  Thu 21 Apr 2011 01:03:09 AM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  4.0 Operating System:  None
Fixed Release:  4.0 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 15 Sep 2013 12:41:08 AM UTC, comment #3: 

Applied a fix along these lines.

Paul D. Smith <psmith>
Group administrator
Thu 21 Apr 2011 04:25:22 PM UTC, comment #2: 

My original one-line patch had two mistakes, which may be a record! In the course of work for enhancement #33138 I made a macro:

#define STREAM_OK(strm) ((fcntl(fileno((strm)), F_GETFD) != -1) || (errno != EBADF))

whose logic would be much better than the original ftell(). Turns out that on many platforms ftell cannot be used on a non-seekable descriptor at all. My development is on Solaris where ftell works as a go/no-go indicator, but that isn't portable. And the EBADF test is required for reasons which are obvious and also discussed in the email thread.

David Boyce <boyski>
Thu 21 Apr 2011 12:55:34 PM UTC, comment #1: 

Note that there is a thread on the bug-make mailing list discussing this in some detail:

http://lists.gnu.org/archive/html/bug-make/2011-04/msg00077.html

David Boyce <boyski>
Thu 21 Apr 2011 01:03:09 AM UTC, original submission:  

Ironically, make's attempt to be super-duper careful about catching write errors to stdout (in the close_stdout function) results in a spurious error message when the user has already closed stdout:

% cat makefile
.PHONY: all
all:; date

% make 1>&-
make: write error

Patch attached.

David Boyce <boyski>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #23282:  make-stdout-patch added by boyski (418B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by boyski (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-09-15 psmith StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.0
    2011-04-21 boyski Attached File- Added make-stdout-patch, #23282

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code