Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!hao!oddjob!mimsy!chris From: chris@mimsy.UUCP Newsgroups: comp.bugs.4bsd Subject: inetd gaffe Message-ID: <8196@mimsy.UUCP> Date: Thu, 27-Aug-87 04:11:14 EDT Article-I.D.: mimsy.8196 Posted: Thu Aug 27 04:11:14 1987 Date-Received: Sat, 29-Aug-87 08:22:30 EDT Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 42 Index: etc/inetd.c 4.3BSD Fix Description: Inetd has a classic asynchronous programming error that could make it `miss' a SIGHUP signal. Repeat-By: Unlikely. Read the code instead. Fix: The extra `if' cuts down on syscall overhead, since nsock==0 is rare. RCS file: RCS/inetd.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c2 -r1.1 -r1.2 *** /tmp/,RCSt1007856 Thu Aug 27 04:03:51 1987 --- /tmp/,RCSt2007856 Thu Aug 27 04:03:53 1987 *************** *** 211,216 **** fd_set readable; ! while (nsock == 0) sigpause(0); readable = allsock; if ((n = select(maxsock + 1, &readable, (fd_set *)0, --- 211,220 ---- fd_set readable; ! if (nsock == 0) { ! (void) sigblock(SIGBLOCK); ! while (nsock == 0) sigpause(0); + (void) sigsetmask(0); + } readable = allsock; if ((n = select(maxsock + 1, &readable, (fd_set *)0, -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) Domain: chris@mimsy.umd.edu Path: seismo!mimsy!chris