summary refs log tree commit diff homepage
diff options
context:
space:
mode:
-rwxr-xr-xserver.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/server.c b/server.c
index fc3b3d0..8ad47ba 100755
--- a/server.c
+++ b/server.c
@@ -260,8 +260,6 @@ static bool clientPut(const struct Client *client, uint8_t color, char cell) {
 int main() {
     int error;
 
-    signal(SIGPIPE, SIG_IGN);
-
     tilesMap();
 
     int server = socket(PF_LOCAL, SOCK_STREAM, 0);
@@ -304,6 +302,10 @@ int main() {
             if (fd < 0) err(EX_IOERR, "accept");
             fcntl(fd, F_SETFL, O_NONBLOCK);
 
+            int on = 1;
+            error = setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &on, sizeof(on));
+            if (error) err(EX_IOERR, "setsockopt");
+
             struct Client *client = clientAdd(fd);
 
             struct kevent event = {
/commit/bin/cash/cash.1?id=004ae03ed543d28aaccb87013740f0c5259045e5&follow=1'>Document PSlitJune McEnroe 2019-01-13Document PS0June McEnroe 2019-01-13Set PS0 in cashJune McEnroe 2019-01-13Add PS0June McEnroe 2019-01-13Change default ENV from cashrc to env.shJune McEnroe 2019-01-13Use colours in cash promptsJune McEnroe 2019-01-12Set PSlit like NetBSD shJune McEnroe 2019-01-12Install gnupg2 from pkgsrc and symlink gpgJune McEnroe 2019-01-12Reference cash builtin man pages in cash.1 SEE ALSOJune McEnroe 2019-01-12Restore cash builtin man page datesJune McEnroe 2019-01-12Use local libeditJune McEnroe 2019-01-12Replace libedit MakefileJune McEnroe 2019-01-11Import /usr/src/lib/libedit from NetBSD 8.0June McEnroe 2019-01-11Add PSlit for prompt escapesJune McEnroe 2019-01-11Don't make depend automaticallyJune McEnroe