]> err.no Git - varnish/commitdiff
Accept EINTR from waitpid()
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 15 Aug 2008 08:30:49 +0000 (08:30 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 15 Aug 2008 08:30:49 +0000 (08:30 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3095 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/mgt_vcc.c

index 1b85f2cb208d44279e661d2cc1edf0cb5221a880..c51afb1aac481722df6b7df5e79b5bd6c1c6266d 100644 (file)
@@ -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))