diff --git a/ChangeLog b/ChangeLog index c1019aa88..cb60c4e13 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-09-27 Richard Frith-Macdonald + + * Source/GSTcpPort.m: ([GSTcphandle+initialize]) ignore SIGPIPE in + case a socket gets closed while we are writing. + 2002-09-26 Richard Frith-Macdonald * Source/Additions/GSMime.m: Fix typo. diff --git a/Source/GSTcpPort.m b/Source/GSTcpPort.m index fca7c3a48..2f8223cbd 100644 --- a/Source/GSTcpPort.m +++ b/Source/GSTcpPort.m @@ -41,7 +41,12 @@ #include #include #include +#ifdef HAVE_SYS_SIGNAL_H +#include +#endif +#ifdef HAVE_SIGNAL_H #include +#endif #ifdef HAVE_UNISTD_H #include /* for gethostname() */ #endif @@ -66,7 +71,6 @@ #include #include #include -#include #include #include /* @@ -443,6 +447,12 @@ static Class runLoopClass; wVersionRequested = MAKEWORD(2, 0); WSAStartup(wVersionRequested, &wsaData); +#else + /* + * If SIGPIPE is not ignored, we will abort on any attempt to + * write to a pipe/socket that has been closed by the other end! + */ + signal(SIGPIPE, SIG_IGN); #endif mutableArrayClass = [NSMutableArray class]; mutableDataClass = [NSMutableData class]; diff --git a/Source/UnixFileHandle.m b/Source/UnixFileHandle.m index b249a9cb9..e022c1403 100644 --- a/Source/UnixFileHandle.m +++ b/Source/UnixFileHandle.m @@ -198,8 +198,8 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin) { #if !defined(__MINGW__) /* - * If SIGPIPE is not ignored, we will abort on any attempt to - * write to a pipe/socket that has been closed by the other end! + * If SIGPIPE is not ignored, we will abort on any attempt to + * write to a pipe/socket that has been closed by the other end! */ signal(SIGPIPE, SIG_IGN); #endif