From 779f70ea7195b12dfce55d721be313e45d266462 Mon Sep 17 00:00:00 2001 From: pw <pw> Date: Thu, 7 May 1998 14:57:25 +0000 Subject: [PATCH] Main loop waiting for client connections was ignoring possibility of a signal (SIGCHLD) occurring while waiting on select in which case it used the untouched descriptor mask bits as if they were valid. This caused the server to hang after two applications were run. Seems to be only a problem on BSD as the Solaris version did not exhibit this. --- motif/server/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/motif/server/main.c b/motif/server/main.c index 90603427e..59d2434d1 100644 --- a/motif/server/main.c +++ b/motif/server/main.c @@ -1,6 +1,6 @@ /* - $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/motif/server/main.c,v 1.9 1997/08/22 20:49:35 pw Exp $ + $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/motif/server/main.c,v 1.10 1998/05/07 14:57:25 pw Exp $ This code was written as part of the CMU Common Lisp project at Carnegie Mellon University, and has been placed in the public domain. @@ -153,6 +153,7 @@ void establish_client(int s) main_err("establish_client: Unable to accept client connection."); printf("Accepted client on fd %d\n",socket); + fflush(stdout); if( will_fork ) pid = fork(); @@ -260,7 +261,7 @@ main(int argc, char **argv) nfound = select(nfds, &rfds, NULL, NULL, 0); if( nfound < 0 && errno != EINTR ) main_err("main: Unable to select on sockets."); - else { + else if( nfound > 0 ){ if( FD_ISSET(unix_socket, &rfds) ) { printf("Accepting client on Unix socket.\n"); fflush(stdout); -- GitLab