diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2014-03-25 20:10:04 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2014-03-25 20:10:04 +0800 |
commit | 3e3d0f8b1841d415e79e25180451538f519ac4e9 (patch) | |
tree | d56b70fd008f7c63f84d2ac6df391bf561bc5ea7 | |
parent | 3c0359ecd073ce180b0e9df5849d12f4256ba7f1 (diff) | |
download | pttbbs-3e3d0f8b1841d415e79e25180451538f519ac4e9.tar pttbbs-3e3d0f8b1841d415e79e25180451538f519ac4e9.tar.gz pttbbs-3e3d0f8b1841d415e79e25180451538f519ac4e9.tar.bz2 pttbbs-3e3d0f8b1841d415e79e25180451538f519ac4e9.tar.lz pttbbs-3e3d0f8b1841d415e79e25180451538f519ac4e9.tar.xz pttbbs-3e3d0f8b1841d415e79e25180451538f519ac4e9.tar.zst pttbbs-3e3d0f8b1841d415e79e25180451538f519ac4e9.zip |
Stupid Linux does not have SO_NOSIGPIPE. I always forget that...
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5967 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/common/sys/net.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pttbbs/common/sys/net.c b/pttbbs/common/sys/net.c index eea5b0ba..29994421 100644 --- a/pttbbs/common/sys/net.c +++ b/pttbbs/common/sys/net.c @@ -155,7 +155,9 @@ int toconnect3(const char *addr, int timeout, int microseconds) perror("socket"); return -1; } +#ifdef SO_NOSIGPIPE setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, &n, sizeof(n)); +#endif serv_name.sun_family = AF_UNIX; strlcpy(serv_name.sun_path, addr, sizeof(serv_name.sun_path)); @@ -175,7 +177,9 @@ int toconnect3(const char *addr, int timeout, int microseconds) perror("socket"); return -1; } +#ifdef SO_NOSIGPIPE setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, &n, sizeof(n)); +#endif if (timed) { |