rtl_tcp: ignore SIGPIPE

Signed-off-by: Steve Markgraf <steve@steve-m.de>
This commit is contained in:
Steve Markgraf 2012-06-05 18:04:10 +02:00
parent 9d58aec8cf
commit 3838df8669
1 changed files with 3 additions and 1 deletions

View File

@ -324,7 +324,7 @@ int main(int argc, char **argv)
WSADATA wsd; WSADATA wsd;
i = WSAStartup(MAKEWORD(2,2), &wsd); i = WSAStartup(MAKEWORD(2,2), &wsd);
#else #else
struct sigaction sigact; struct sigaction sigact, sigign;
#endif #endif
while ((opt = getopt(argc, argv, "a:p:f:g:s:b:d:")) != -1) { 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; sigact.sa_handler = sighandler;
sigemptyset(&sigact.sa_mask); sigemptyset(&sigact.sa_mask);
sigact.sa_flags = 0; sigact.sa_flags = 0;
sigign.sa_handler = SIG_IGN;
sigaction(SIGINT, &sigact, NULL); sigaction(SIGINT, &sigact, NULL);
sigaction(SIGTERM, &sigact, NULL); sigaction(SIGTERM, &sigact, NULL);
sigaction(SIGQUIT, &sigact, NULL); sigaction(SIGQUIT, &sigact, NULL);
sigaction(SIGPIPE, &sigign, NULL);
#else #else
SetConsoleCtrlHandler( (PHANDLER_ROUTINE) sighandler, TRUE ); SetConsoleCtrlHandler( (PHANDLER_ROUTINE) sighandler, TRUE );
#endif #endif