Commit 6b11eec1 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Accept EINTR from waitpid()



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3095 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 39ca7b74
......@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment