From: phk Date: Fri, 15 Aug 2008 08:30:49 +0000 (+0000) Subject: Accept EINTR from waitpid() X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17166b9fd4acb1fcecde84b4e3555e280519664d;p=varnish Accept EINTR from waitpid() git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3095 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- 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))