Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1.chuqui 4/7/84; site voder.UUCP Path: utzoo!linus!decvax!ittvax!dcdwest!sdcsvax!sdcrdcf!hplabs!nsc!voder!jeff From: jeff@voder.UUCP Newsgroups: net.news.b Subject: vnews bug on 4.2 systems Message-ID: <281@voder.UUCP> Date: Tue, 10-Jul-84 00:04:40 EDT Article-I.D.: voder.281 Posted: Tue Jul 10 00:04:40 1984 Date-Received: Thu, 12-Jul-84 01:16:03 EDT Organization: National Semiconductor, Santa Clara Lines: 151 After installing vnews recently on our 4.2 system I noticed that the time field in the prompt line wasn't being updated. Long hours (and several wild goose chases) later I discovered the following problems. In visual.c: vgetc() uses select() to wait for input from the keyboard. Unfortunately, there is already a subroutine called select defined in rfuncs.c. The solution here is easy: edit rfuncs.c and readr.c to change the names of the innocent. *** diff old.rfuncs.c rfuncs.c 214c214 < || !select(&h, FALSE)) { --- > || !selectart(&h, FALSE)) { 417c417 < select(hp, insist) --- > selectart(hp, insist) *** diff old.readr.c readr.c 1163c1163 < || (!rfq && !select(&h, abs))) { --- > || (!rfq && !selectart(&h, abs))) { In visual.c the changes are slightly more involved: *** old.visual.c Mon Jul 9 23:04:32 1984 --- visual.c Mon Jul 9 23:04:54 1984 *************** *** 1802,1803 i = 60 - t->tm_sec; alarm(i > 30? 30 : i); /* reset alarm */ --- 1802,1806 ----- i = 60 - t->tm_sec; + #ifdef BSD4_2 + alarm((unsigned) i); /* reset alarm */ + #else alarm(i > 30? 30 : i); /* reset alarm */ *************** *** 1803,1804 alarm(i > 30? 30 : i); /* reset alarm */ hour = t->tm_hour % 12; --- 1806,1808 ----- alarm(i > 30? 30 : i); /* reset alarm */ + #endif hour = t->tm_hour % 12; *************** *** 1882,1883 int readfds, exceptfds; #endif --- 1886,1888 ----- int readfds, exceptfds; + int nfound; #endif *************** *** 1902,1904 #ifdef BSD4_2 ! /* use a read because it can be interrupted */ readfds = 1; exceptfds = 1; --- 1907,1909 ----- #ifdef BSD4_2 ! /* use a select because it can be interrupted */ readfds = 1; exceptfds = 1; *************** *** 1904,1907 readfds = 1; exceptfds = 1; ! select(1,&readfds,0,&exceptfds,0); ! if (readfds & 1) { /* got a key, go ahead and get it */ innleft = read(0,inbuf,INBUFSIZ); --- 1909,1912 ----- readfds = 1; exceptfds = 1; ! nfound = select(1,&readfds,0,&exceptfds,0); ! if (nfound > 0) { /* got a key, go ahead and get it */ innleft = read(0,inbuf,INBUFSIZ); *************** *** 2041,2042 register int i; unsigned oldalarm; --- 2046,2050 ----- register int i; + #ifdef BSD4_2 + int mask; + #else unsigned oldalarm; *************** *** 2042,2043 unsigned oldalarm; --- 2050,2052 ----- unsigned oldalarm; + #endif *************** *** 2047,2048 */ oldalarm = alarm((unsigned)0); /* suspend interrupts while writing */ --- 2056,2060 ----- */ + #ifdef BSD4_2 + mask = sigblock(1<