mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Ignore SIGPIPE
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14592 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
12a51b603f
commit
bbaa2c7d8b
3 changed files with 18 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
|||
2002-09-27 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GSTcpPort.m: ([GSTcphandle+initialize]) ignore SIGPIPE in
|
||||
case a socket gets closed while we are writing.
|
||||
|
||||
2002-09-26 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/Additions/GSMime.m: Fix typo.
|
||||
|
|
|
@ -41,7 +41,12 @@
|
|||
#include <Foundation/NSDebug.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_SYS_SIGNAL_H
|
||||
#include <sys/signal.h>
|
||||
#endif
|
||||
#ifdef HAVE_SIGNAL_H
|
||||
#include <signal.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h> /* for gethostname() */
|
||||
#endif
|
||||
|
@ -66,7 +71,6 @@
|
|||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#include <netdb.h>
|
||||
#include <signal.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/file.h>
|
||||
/*
|
||||
|
@ -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];
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue