chiark / gitweb /
do ignore sigpipe; move inndcommfail
[inn-innduct.git] / backends / innduct.c
index 33adaf8097f4692536f11e15e78b884c87f58e0e..c83a02c0243d3065a6ef1cade828b819d37ead88 100644 (file)
@@ -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();