~panda-roux/MoonGem

348aa39f36f31fc0a8086fc7c9593bd40bc06302 — panda-roux 5 months ago 49f1317 2.0.1
ignoring SIGPIPE so that weird clients don't cause problems
1 files changed, 3 insertions(+), 0 deletions(-)

M src/signals.c
M src/signals.c => src/signals.c +3 -0
@@ 18,12 18,15 @@ static void signal_continue_cb(evutil_socket_t sig, short events, void* data) {
  event_base_loopcontinue((struct event_base*)data);
}

static void signal_ignore_cb(evutil_socket_t sig, short events, void* data) {}

typedef struct {
  event_callback_fn cb;
  short signal;
} sigcb_t;

static sigcb_t callbacks[] = {{signal_shutdown_cb, SIGINT},
                              {signal_ignore_cb, SIGPIPE},
                              {signal_shutdown_cb, SIGTERM},
                              {signal_termstop_cb, SIGTSTP},
                              {signal_continue_cb, SIGCONT}};