Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 6d676eb79bbeb59c40865956b285f799ad2e8753
Ticket: 439114ffffffffffffffffffffffffffffffffff
Channel buffering affects [close] status
User & Date: chris_nelson on 2001-07-13 22:19:42
Changes

  1. icomment:
    Logged In: YES 
    user_id=107514
    
    OK.  The problem seems to be in PipeCloseProc which says:
    
        if (pipePtr->isNonBlocking || TclInExit()) {
        
            /*
             * If the channel is non-blocking or Tcl is being cleaned up, just
             * detach the children PIDs, reap them (important if we are in a
             * dynamic load module), and discard the errorFile.
             */
            
            Tcl_DetachPids(pipePtr->numPids, pipePtr->pidPtr);
            Tcl_ReapDetachedProcs();
    
            if (pipePtr->errorFile) {
        TclpCloseFile(pipePtr->errorFile);
            }
        } else {
            
            /*
             * Wrap the error file into a channel and give it to the cleanup
             * routine.
             */
    
            if (pipePtr->errorFile) {
        errChan = Tcl_MakeFileChannel(
    (ClientData) GetFd(pipePtr->errorFile), TCL_READABLE);
            } else {
                errChan = NULL;
            }
            result = TclCleanupChildren(interp, pipePtr->numPids, pipePtr->pidPtr,
                    errChan);
        }
    
    The first clause isn't specific enough, we only want to discard or ignore the child's status if the child is still 
    running.  If the pipe is nonblocking BUT the child is done, we _can_ (and should!) get the child's exit status. 
    I'm looking into how to determine if the child is done or not.
    
    
    
  2. login: "chris_nelson"
  3. mimetype: "text/plain"
  4. username: "chris_nelson"