Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: c858f33291d38527544d58e72ad5230dd9aa6da1
Ticket: 219327ffffffffffffffffffffffffffffffffff
close $pipe doesn't return non-zero exit status
User & Date: andreas_kupries on 2006-03-17 03:18:01
Changes

  1. icomment:
    Logged In: YES 
    user_id=75003
    
    I believe that the are actually seeing a bug in Tcl 8.2.1.
    In Nov 29, 1999 Jeff Hobbs fixed a problem in tclUnixPipe,
    apparently the blocking mode of the channel was not properly
    set before.
    
    So, a channel with -blocking 0 does not report errors. See
    tclUnixPipe.c, PipeCloseProc. This code is present in Tcl
    8.2.1 as well, in unchanged form. 8.2.1 reported the error
    despite this because of the bad information it had about the
    blocking mode of the pipe.
    
    To get the error from the pipe run
        fconfigure -blocking 1 $fd
        close $fd
    instead of just a 'close $fd'.
    
    I have to admit that the manpage of close is written poorly
    when it comes to explaining the handling of -blocking. The
    behaviour is descried in the the manpage of open, in the
    section about command pipelines.
    
    I recommend to try and fix the documentation. The core is
    ok, and the example script simply falls into a trap for the
    unwary.
    
    I will not mind if this bug is simply closed. As described
    by the submitter it is 'Invalid'.
    
    
  2. login: "andreas_kupries"
  3. mimetype: "text/plain"
  4. priority changed to: "2"
  5. resolution changed to: "Invalid"
  6. username: "andreas_kupries"