Artifacts Associated With Ticket 218183ffffffffff
Ticket change [de6bbf2288] (rid 114849) by nobody on 2000-10-26 00:54:14:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized 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 initialized to: "final: 8.1.1"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "69. Other"
- title initialized to: "this patch fixes incorrect buffering prob"
- type initialized to: "RFE"
Ticket change [54d0a86f6c] (rid 94016) by welch on 2000-10-26 08:16:55:
- closedate changed to: "2000-10-26T01:16:55"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [9de835aeb8] (rid 96387) by dgp on 2001-04-23 01:52:05:
- foundin changed to: "None"
- status changed to: "Open"
- subsystem changed to: "None"
Ticket change [edee2ac825] (rid 103991) by dgp on 2001-04-23 01:54:04:
- closedate changed to: "2001-04-22T18:54:04"
- closer changed to: "dgp"
- status changed to: "Closed"
- subsystem changed to: "25. Channel System"