ports/lang/nekovm/patches/patch-libs_common_socket_c

25 lines
788 B
Text

no SO_NOSIGPIPE on OpenBSD
Index: libs/common/socket.c
--- libs/common/socket.c.orig
+++ libs/common/socket.c
@@ -73,10 +73,6 @@ void psock_init() {
PSOCK psock_create() {
PSOCK s = socket(AF_INET,SOCK_STREAM,0);
-# if defined(OS_MAC) || defined(OS_BSD)
- if( s != INVALID_SOCKET )
- setsockopt(s,SOL_SOCKET,SO_NOSIGPIPE,NULL,0);
-# endif
# ifdef OS_POSIX
// we don't want sockets to be inherited in case of exec
{
@@ -120,7 +116,7 @@ PHOST phost_resolve( const char *host ) {
PHOST ip = inet_addr(host);
if( ip == INADDR_NONE ) {
struct hostent *h;
-# if defined(OS_WINDOWS) || defined(OS_MAC) || defined(OS_CYGWIN)
+# if defined(OS_WINDOWS) || defined(OS_MAC) || defined(OS_CYGWIN) || defined(__OpenBSD__)
h = gethostbyname(host);
# else
struct hostent hbase;