Skip to content
Snippets Groups Projects
Commit 779f70ea authored by pw's avatar pw
Browse files

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.
parent 805028e8
No related branches found
No related tags found
No related merge requests found
/* /*
$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 This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University, and has been placed in the public domain. Carnegie Mellon University, and has been placed in the public domain.
...@@ -153,6 +153,7 @@ void establish_client(int s) ...@@ -153,6 +153,7 @@ void establish_client(int s)
main_err("establish_client: Unable to accept client connection."); main_err("establish_client: Unable to accept client connection.");
printf("Accepted client on fd %d\n",socket); printf("Accepted client on fd %d\n",socket);
fflush(stdout);
if( will_fork ) if( will_fork )
pid = fork(); pid = fork();
...@@ -260,7 +261,7 @@ main(int argc, char **argv) ...@@ -260,7 +261,7 @@ main(int argc, char **argv)
nfound = select(nfds, &rfds, NULL, NULL, 0); nfound = select(nfds, &rfds, NULL, NULL, 0);
if( nfound < 0 && errno != EINTR ) if( nfound < 0 && errno != EINTR )
main_err("main: Unable to select on sockets."); main_err("main: Unable to select on sockets.");
else { else if( nfound > 0 ){
if( FD_ISSET(unix_socket, &rfds) ) { if( FD_ISSET(unix_socket, &rfds) ) {
printf("Accepting client on Unix socket.\n"); printf("Accepting client on Unix socket.\n");
fflush(stdout); fflush(stdout);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment