Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site allegra.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!jpl From: jpl@allegra.UUCP (John P. Linderman) Newsgroups: net.bugs.uucp Subject: Re: Re: hung line help needed Message-ID: <2923@allegra.UUCP> Date: Sun, 25-Nov-84 11:54:06 EST Article-I.D.: allegra.2923 Posted: Sun Nov 25 11:54:06 1984 Date-Received: Mon, 26-Nov-84 02:04:09 EST References: <85@daemon.UUCP> <33700001@trsvax.UUCP> Organization: AT&T Bell Laboratories, Murray Hill Lines: 37 Could you pass the code (or diffs) along for the timeout fix you've added? {microsoft,ctvax}!trsvax!ron I think I can do better. Kirk Smith pointed out a bug in sleep(3) that causes alarms to be masked off and never rearmed. Since uucico does both sleeps and alarms, his fix (enclosed below) looks like it will cure the disease whereas mine merely treated the symptoms. From: pur-ee!ef:ks (Kirk Smith) Received: by ef.ECN; Mon, 27 Aug 84 10:32:00 est (4.12/5.20) Message-Id: <8408271532.AA03198@ef.ECN> Subject: sleep(3) and SIGALRM Index: /usr/src/lib/libc/gen/sleep.c 4.2BSD Apparently-To: ucbvax!4bsd-bugs Description: After a call to sleep(), the signal SIGALRM remains blocked. Repeat-By: main() { sleep(1); alarm(1); } This program will never terminate. Fix: In sleep.c add the following line to set the mask back to the old mask before returning as follows: (void) sigvec(SIGALRM, &ovec, (struct sigvec *)0); (void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0); +++ (void) sigsetmask(omask); } John P. Linderman (Not alarmed by the slip in sleep) allegra!jpl