jeff@voder.UUCP (Jeff Gilliam) (07/11/84)
OOPS! It seems I made a *minor* mistake in my previous posting
of vnews fixes for 4.2 BSD. Actually, there were two errors which,
taken together, actually work! (Two wrongs make a right!?) Anyway,
the corrected (really!) fix is included. Sorry for any confusion.
*** old.visual.c Mon Jul 9 23:04:32 1984
--- visual.c Wed Jul 11 01:15:06 1984
***************
*** 1802,1803
i = 60 - t->tm_sec;
alarm(i > 30? 30 : i); /* reset alarm */
--- 1802,1808 -----
i = 60 - t->tm_sec;
+ #ifdef BSD4_2
+ alarm((unsigned) i); /* reset alarm */
+ #else
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,2049 -----
register int i;
+ #ifndef BSD4_2
unsigned oldalarm;
+ #endif
***************
*** 2047,2048
*/
oldalarm = alarm((unsigned)0); /* suspend interrupts while writing */
--- 2054,2058 -----
*/
+ #ifndef BSD4_2
oldalarm = alarm((unsigned)0); /* suspend interrupts while writing */
+ #endif
for (p = outbuf; p < outnext ; p += i)
***************
*** 2059,2060
outnext = outbuf;
alarm(oldalarm); /* reset the timer */
--- 2068,2072 -----
outnext = outbuf;
+ #ifndef BSD4_2
alarm(oldalarm); /* reset the timer */
+ #endif
}
Jeff Gilliam