Overview
| Artifact ID: | de6bbf228852553467b0eb8682fc577a0674f042 |
|---|---|
| Ticket: | 218183ffffffffffffffffffffffffffffffffff
this patch fixes incorrect buffering prob |
| User & Date: | nobody on 2000-10-26 00:54:14 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- 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. - foundin changed to: "final: 8.1.1"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "69. Other"
- title changed to: "this patch fixes incorrect buffering prob"
- type changed to: "RFE"