Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: de6bbf228852553467b0eb8682fc577a0674f042
Ticket: 218183ffffffffffffffffffffffffffffffffff
this patch fixes incorrect buffering prob
User & Date: nobody on 2000-10-26 00:54:14
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 2335 Bug
    Version: 8.1.1
    SubmitDate: '1999-07-07'
    LastModified: '1999-07-07'
    Severity: MED
    Status: Closed
    Submitter: techsupp
    ChangedBy: stanton
    OS: Solaris
    OSVersion: SunOS muffin 5.6 Generic sun4m sparc SUNW,SPARCstation-20
    Machine: Other
    FixedDate: '1999-07-07'
    ClosedDate: '1999-07-07'
    
    
    Name:
    
    Don Libes
    
    
    
    CVS:
    
    * RCS: @(#) $Id: tclUnixChan.c,v 1.10 1999/04/16 00:48:04 stanton Exp $
    
    
    
    Comments:
    
    This patch makes the fconfigure man page accurate where it says:
    
        
    
                                            The  default  is for
    
         -buffering to be set to full except for  channels  that
    
         connect  to  terminal-like  devices; for these channels
    
         the initial setting is line.
    
    
    
    ReproducibleScript:
    
    Call the following script "foo":
    
        ##### foo ######
    
        puts a
    
        puts b
    
        ##### end of foo ######
    
        
    
        From the command line, do this:
    
        % truss -twrite tclsh foo > /dev/null
    
    
    
    ObservedBehavior:
    
    write(1, " a\n", 2)                             = 2
    
        write(1, " b\n", 2)                             = 2
    
        
    
        This is incorrect behavior.  The man page says that file channels are
    
        full-buffered (by default) unless they are ttys.  Here, we see
    
        /dev/null
    
        is behaving line-buffered, not full-buffered.
    
    
    
    DesiredBehavior:
    
    write(1, " a\n b\n", 4)                         = 4
    
    
    
    Patch:
    
    *** tclUnixChan.cTue Jul  6 12:43:18 1999
    
    --- /tmp/tclUnixChan.cTue Jul  6 12:33:04 1999
    
    ***************
    
    *** 2409,2415 ****
    
                  }
    
          fd = 0;
    
          mode = TCL_READABLE;
    
    !             bufMode = "line";
    
                  break;
    
              case TCL_STDOUT:
    
                  if ((lseek(1, (off_t) 0, SEEK_CUR) == -1) &&
    
    --- 2409,2416 ----
    
                  }
    
          fd = 0;
    
          mode = TCL_READABLE;
    
    !     if (isatty(fd)) bufMode = "line";
    
    !     else bufMode = "full";
    
                  break;
    
              case TCL_STDOUT:
    
                  if ((lseek(1, (off_t) 0, SEEK_CUR) == -1) &&
    
    ***************
    
    *** 2418,2424 ****
    
                  }
    
          fd = 1;
    
          mode = TCL_WRITABLE;
    
    !             bufMode = "line";
    
                  break;
    
              case TCL_STDERR:
    
                  if ((lseek(2, (off_t) 0, SEEK_CUR) == -1) &&
    
    --- 2419,2426 ----
    
                  }
    
          fd = 1;
    
          mode = TCL_WRITABLE;
    
    !     if (isatty(fd)) bufMode = "line";
    
    !     else bufMode = "full";
    
                  break;
    
              case TCL_STDERR:
    
                  if ((lseek(2, (off_t) 0, SEEK_CUR) == -1) &&
    
    
    
    PatchFiles:
    
    tclUnixChan.c
    
    
    
    
    
    07/07/1999 11:15 - stanton - This patch introduces a backwards incompatibility that may break many scripts.  It definitely causes hangs in the test suite (e.g. io.test) because many tests assume that Tcl is in line mode on the stdio channels.
    
    
    
  4. foundin changed to: "final: 8.1.1"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to: "this patch fixes incorrect buffering prob"
  11. type changed to: "RFE"