Index: src/OFStream.m ================================================================== --- src/OFStream.m +++ src/OFStream.m @@ -22,10 +22,14 @@ #include #include #include #include + +#ifndef _WIN32 +# include +#endif #import "OFStream.h" #import "OFString.h" #import "OFDataArray.h" #import "OFExceptions.h" @@ -32,10 +36,20 @@ #import "macros.h" #import "asprintf.h" @implementation OFStream +#ifndef _WIN32 ++ (void)initialize +{ + if (self != [OFStream class]) + return; + + signal(SIGPIPE, SIG_IGN); +} +#endif + - init { if (isa == [OFStream class]) { Class c = isa; [self release]; Index: src/OFTCPSocket.m ================================================================== --- src/OFTCPSocket.m +++ src/OFTCPSocket.m @@ -350,16 +350,16 @@ addrlen = sizeof(struct sockaddr); @try { addr = [newsock allocMemoryWithSize: sizeof(struct sockaddr)]; } @catch (id e) { - [newsock dealloc]; + [newsock release]; @throw e; } if ((s = accept(sock, addr, &addrlen)) == INVALID_SOCKET) { - [newsock dealloc]; + [newsock release]; @throw [OFAcceptFailedException newWithClass: isa]; } newsock->sock = s; newsock->sockAddr = addr;