From 663797c732a980c70cb95b41fb9aba24b6714bd5 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 7 Apr 2010 21:10:34 +0100 Subject: [PATCH] do ignore sigpipe; move inndcommfail --- backends/innduct.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/backends/innduct.c b/backends/innduct.c index 33adaf8..c83a02c 100644 --- a/backends/innduct.c +++ b/backends/innduct.c @@ -1542,11 +1542,6 @@ static void *statemc_check_oldinput_done(oop_source *lp, static pid_t inndcomm_child; -static void inndcommfail(const char *what) { - syswarn("error communicating with innd: %s failed: %s", what, ICCfailure); - exit(INNDCOMMCHILD_ESTATUS_FAIL); -} - static void *inndcomm_event(oop_source *lp, int fd, oop_event e, void *u) { assert(inndcomm_child); int status= xwaitpid(&inndcomm_child, "inndcomm"); @@ -1593,6 +1588,11 @@ static void *inndcomm_event(oop_source *lp, int fd, oop_event e, void *u) { sms= sm_FLUSHFAIL;; } +static void inndcommfail(const char *what) { + syswarn("error communicating with innd: %s failed: %s", what, ICCfailure); + exit(INNDCOMMCHILD_ESTATUS_FAIL); +} + void spawn_inndcomm_flush(void) { int pipefds[2]; @@ -1680,7 +1680,8 @@ EVERY(period, {PERIOD_SECONDS,0}, { }); main { - ignore sigpipe; + if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) + sysdie("could not ignore SIGPIPE"); if (!filemon_init()) filepoll_schedule(); period_schedule(); -- 2.30.2