aboutsummaryrefslogtreecommitdiffstats
path: root/src/rtl_tcp.c
diff options
context:
space:
mode:
authorSteve Markgraf <steve@steve-m.de>2012-06-05 18:04:10 +0200
committerSteve Markgraf <steve@steve-m.de>2012-06-05 18:04:10 +0200
commit3838df86699d50b2ac9ccd2b801383578f4e196f (patch)
tree16b1de576a468a5306c97ceb3e89b96518b377cf /src/rtl_tcp.c
parent9d58aec8cf9e711d927beccc51120648ed024d9f (diff)
rtl_tcp: ignore SIGPIPE
Signed-off-by: Steve Markgraf <steve@steve-m.de>
Diffstat (limited to 'src/rtl_tcp.c')
-rw-r--r--src/rtl_tcp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rtl_tcp.c b/src/rtl_tcp.c
index 6b63c0a..ff30908 100644
--- a/src/rtl_tcp.c
+++ b/src/rtl_tcp.c
@@ -324,7 +324,7 @@ int main(int argc, char **argv)
WSADATA wsd;
i = WSAStartup(MAKEWORD(2,2), &wsd);
#else
- struct sigaction sigact;
+ struct sigaction sigact, sigign;
#endif
while ((opt = getopt(argc, argv, "a:p:f:g:s:b:d:")) != -1) {
@@ -378,9 +378,11 @@ int main(int argc, char **argv)
sigact.sa_handler = sighandler;
sigemptyset(&sigact.sa_mask);
sigact.sa_flags = 0;
+ sigign.sa_handler = SIG_IGN;
sigaction(SIGINT, &sigact, NULL);
sigaction(SIGTERM, &sigact, NULL);
sigaction(SIGQUIT, &sigact, NULL);
+ sigaction(SIGPIPE, &sigign, NULL);
#else
SetConsoleCtrlHandler( (PHANDLER_ROUTINE) sighandler, TRUE );
#endif