Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!utah-cs!donn From: donn@utah-cs.UUCP (Donn Seeley) Newsgroups: net.unix Subject: Re: About that "w+" bug in 4.3... Message-ID: <3955@utah-cs.UUCP> Date: Thu, 16-Oct-86 20:57:15 EDT Article-I.D.: utah-cs.3955 Posted: Thu Oct 16 20:57:15 1986 Date-Received: Fri, 17-Oct-86 03:21:38 EDT References: <1333@uw-june> Organization: University of Utah CS Dept Lines: 47 Summary: run 4.3, not 4.3 beta Here's some fixes I made to the 4.3 beta fputs(). The first change solves a problem with _IORW stdio FILEs; the second fixes a problem with unbuffered FILEs. The source is in /usr/src/lib/libc/vax/stdio/fputs.c. ------------------------------------------------------------------------ *** /tmp/,RCSt1013008 Mon Oct 13 22:59:50 1986 --- /tmp/,RCSt2013008 Mon Oct 13 22:59:51 1986 *************** *** 64,71 **** jbr 2f 1: ! tstl _BASE(IOP) /* Has a buffer been allocated? */ ! jneq 2f pushl IOP /* Get _flsbuf() to do the work */ pushl $0 calls $2,__flsbuf --- 64,71 ---- jbr 2f 1: ! tstl _CNT(IOP) /* Has a buffer been allocated? */ ! jgtr 2f pushl IOP /* Get _flsbuf() to do the work */ pushl $0 calls $2,__flsbuf *************** *** 90,95 **** --- 90,97 ---- movl r3,_PTR(IOP) /* Fix up IOP */ subl2 COUNT,_CNT(IOP) bitw $LBF,_FLAG(IOP) /* If line buffered... */ + jneq 1f + tstw UNBUF /* or unbuffered... */ jneq 1f tstl _CNT(IOP) /* or a full buffer... */ jgtr 2f ------------------------------------------------------------------------ Equivalent fixes were made to puts.c, too. This fix should be in the 4.3 BSD release -- if you're not running it, you probably should be. Donn Seeley University of Utah CS Dept donn@utah-cs.arpa 40 46' 6"N 111 50' 34"W (801) 581-5668 decvax!utah-cs!donn PS -- There's at least one minor bug in the distributed fputs(), too; so it goes.