Skip to content

Commit

Permalink
Modified FreeRDP core to ignore SIGPIPE signal. This signal was being…
Browse files Browse the repository at this point in the history
… generated during a call to SSL_shutdown when the socket is in a disconnected state. The proper way to handle this is to ignore SIGPIPE and allow the write system call to report an errno of EPIPE.
  • Loading branch information
vworkspace committed Jan 20, 2014
1 parent 5ce6b78 commit 25f8340
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libfreerdp/utils/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ static void fatal_handler(int signum)
struct sigaction default_sigaction;
sigset_t this_mask;

printf("fatal_handler: signum=%d\n", signum);

if (terminal_needs_reset)
tcsetattr(terminal_fildes, TCSAFLUSH, &orig_flags);

Expand All @@ -74,7 +76,6 @@ const int fatal_signals[] =
SIGILL,
SIGINT,
SIGKILL,
SIGPIPE,
SIGQUIT,
SIGSEGV,
SIGSTOP,
Expand Down Expand Up @@ -128,6 +129,9 @@ int freerdp_handle_signals(void)

pthread_sigmask(SIG_SETMASK, &orig_set, NULL);

/* Ignore SIGPIPE signal. */
signal(SIGPIPE, SIG_IGN);

return 0;
}

Expand Down

0 comments on commit 25f8340

Please sign in to comment.