From: phk Date: Sun, 17 Sep 2006 09:06:08 +0000 (+0000) Subject: Make sure we get the error messages from a dying child. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=929b1ec7f9caa8fd888c000f9c7d1b6f1fadb17b;p=varnish Make sure we get the error messages from a dying child. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1046 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/mgt_child.c b/varnish-cache/bin/varnishd/mgt_child.c index b4f679bb..8ff3babf 100644 --- a/varnish-cache/bin/varnishd/mgt_child.c +++ b/varnish-cache/bin/varnishd/mgt_child.c @@ -173,7 +173,9 @@ start_child(void) if (mgt_push_vcls_and_start(&i, &p)) { fprintf(stderr, "Pushing vcls failed:\n%s\n", p); free(p); - exit (2); + /* Pick up any stuff lingering on stdout/stderr */ + child_listener(NULL, EV_RD); + exit(2); } child_state = CH_RUNNING; } @@ -235,6 +237,9 @@ mgt_sigchld(struct ev *e, int what) fprintf(stderr, "Cache child died pid=%d status=0x%x\n", r, status); child_pid = -1; + /* Pick up any stuff lingering on stdout/stderr */ + child_listener(NULL, EV_RD); + if (child_state == CH_RUNNING) { child_state = CH_DIED; fprintf(stderr, "Clean child\n");