From 66cdb3d4f427a1978dad56a66c1bf1085939601c Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Thu, 31 Dec 2015 15:24:33 -0500 Subject: handle SIGPIPE --- src/client.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/client.c b/src/client.c index 03ff259..2784987 100644 --- a/src/client.c +++ b/src/client.c @@ -288,6 +288,11 @@ void client_main(int fd, struct sockaddr_in *addr, int total, int to, int from) output_locked = 0; + struct sigaction sa; + sa.sa_handler = SIG_DFL; + if(sigaction(SIGPIPE, &sa, NULL) < 0) + error("sigaction"); + telnet_init(); char *ip = inet_ntoa(addr->sin_addr); -- cgit v1.1