diff options
author | jshalf <jshalf@bfcf8e34-485d-4d46-a995-1fd6fa6fb178> | 2000-11-01 05:22:48 +0000 |
---|---|---|
committer | jshalf <jshalf@bfcf8e34-485d-4d46-a995-1fd6fa6fb178> | 2000-11-01 05:22:48 +0000 |
commit | b45b84a505c294e2e2c9656ac1e8f409fb932baa (patch) | |
tree | 4d7b539e818e61715eee0ad413de70ad9830311b | |
parent | 80e9eaef3a4486f2a24c97a600d49a8da0a6ff18 (diff) |
Ignore SIGPIPE.
Try to figure out why we get periodic crashes on IsoView disconnect.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IsoSurfacer/trunk@18 bfcf8e34-485d-4d46-a995-1fd6fa6fb178
-rw-r--r-- | src/Sockets.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/Sockets.c b/src/Sockets.c index 05d96ed..7556424 100644 --- a/src/Sockets.c +++ b/src/Sockets.c @@ -41,6 +41,10 @@ #endif /* HAVE_WINSOCK2_H */ #include <errno.h> +#ifndef WIN32 +#include <signal.h> +#endif + #include "IsoSurfacerInit.h" #include "IsoSurfacerGH.h" @@ -370,9 +374,18 @@ IsoCommand *Iso_PollCommand(cGH *GH,IsoCommand *cmd){ /* get next command on the control socket list */ for(this = controlsocklist; this; this = this->next){ if(FD_ISSET (this->filedes, &read_fd_set)){ + int r; + /* puts("StartIsoRead"); */ + r=Iso_Read(this,cmd->buffer,64+64+64); + /* puts("EndIsoRead"); */ /* Data arriving on an already-connected socket. */ - if (Iso_Read (this, cmd->buffer,64+64+64) <= 0){ + if (r <= 0){ + puts("Destroy Socket"); SocketDestroy(this, &controlsocklist); + puts("done destroy"); + if(controlsocklist==NULL) puts("*********It did the right thing"); + else puts("*******baaad socket... bad bad bad..."); + return NULL; } else return cmd; /* return immediately with the new command (first available) */ } @@ -930,6 +943,8 @@ static int InitialiseTCP(void) static int InitialiseTCP(void) { + /* Make sure we ignore SIGPIPE */ + signal(SIGPIPE,SIG_IGN); return 0; } |