Mailing List Archive

r1046 - trunk/varnish-cache/bin/varnishd
Author: phk
Date: 2006-09-17 11:06:08 +0200 (Sun, 17 Sep 2006)
New Revision: 1046

Modified:
trunk/varnish-cache/bin/varnishd/mgt_child.c
Log:
Make sure we get the error messages from a dying child.


Modified: trunk/varnish-cache/bin/varnishd/mgt_child.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_child.c 2006-09-17 08:44:53 UTC (rev 1045)
+++ trunk/varnish-cache/bin/varnishd/mgt_child.c 2006-09-17 09:06:08 UTC (rev 1046)
@@ -173,7 +173,9 @@
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 @@
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");