From 0c845f792bcbcdf24f6528ed1da1d175a2fae37b Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 17 Jun 2008 10:15:20 +0000 Subject: [PATCH] Now that varnishd's -d -d mode behaves correctly, use a more civilized shutdown sequence. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2726 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishtest/vtc_varnish.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/varnish-cache/bin/varnishtest/vtc_varnish.c b/varnish-cache/bin/varnishtest/vtc_varnish.c index 84b9b0dd..88704fc1 100644 --- a/varnish-cache/bin/varnishtest/vtc_varnish.c +++ b/varnish-cache/bin/varnishtest/vtc_varnish.c @@ -38,6 +38,7 @@ #include #include +#include #include @@ -267,18 +268,21 @@ static void varnish_wait(struct varnish *v) { void *p; + int status, r; if (v->cli_fd < 0) return; varnish_stop(v); printf("## %-4s Wait\n", v->name); - AZ(kill(v->pid, SIGKILL)); - AZ(pthread_cancel(v->tp)); - AZ(pthread_join(v->tp, &p)); - close(v->fds[0]); - close(v->fds[1]); - close(v->cli_fd); + AZ(close(v->cli_fd)); v->cli_fd = -1; + + AZ(close(v->fds[1])); + + AZ(pthread_join(v->tp, &p)); + AZ(close(v->fds[0])); + r = wait4(v->pid, &status, 0, NULL); + printf("## %-4s R %d Status: %04x\n", v->name, r, status); } /********************************************************************** -- 2.39.5