From 17166b9fd4acb1fcecde84b4e3555e280519664d Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 15 Aug 2008 08:30:49 +0000 Subject: [PATCH] Accept EINTR from waitpid() git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3095 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/mgt_vcc.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/varnish-cache/bin/varnishd/mgt_vcc.c b/varnish-cache/bin/varnishd/mgt_vcc.c index 1b85f2cb..c51afb1a 100644 --- a/varnish-cache/bin/varnishd/mgt_vcc.c +++ b/varnish-cache/bin/varnishd/mgt_vcc.c @@ -143,7 +143,7 @@ mgt_run_cc(const char *source, struct vsb *sb) char sf[] = "./vcl.########.c"; char of[sizeof sf + 1]; char *retval; - int p[2], sfd, srclen, status; + int rv, p[2], sfd, srclen, status; pid_t pid; void *dlh; struct vlu *vlu; @@ -213,12 +213,15 @@ mgt_run_cc(const char *source, struct vsb *sb) AZ(close(p[0])); VLU_Destroy(vlu); (void)unlink(sf); - if (waitpid(pid, &status, 0) < 0) { - vsb_printf(sb, "%s(): waitpid() failed: %s", - __func__, strerror(errno)); - (void)unlink(of); - return (NULL); - } + do { + rv = waitpid(pid, &status, 0); + if (rv < 0 && errno != EINTR) { + vsb_printf(sb, "%s(): waitpid() failed: %s", + __func__, strerror(errno)); + (void)unlink(of); + return (NULL); + } + } while (rv < 0); if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) { vsb_printf(sb, "%s(): Compiler failed", __func__); if (WIFEXITED(status)) -- 2.39.5