[master] cd9e5db GCC doesn't think NULL is a valid terminator of execl(2).

Poul-Henning Kamp phk at FreeBSD.org
Wed Jan 10 15:08:06 UTC 2018


commit cd9e5db018ceebaa05dbb7810425ba91a1e56dfc
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Jan 10 15:07:04 2018 +0000

    GCC doesn't think NULL is a valid terminator of execl(2).
    
    I don't think GCC is a valid compiler for sensible code.

diff --git a/bin/varnishtest/vtc_process.c b/bin/varnishtest/vtc_process.c
index 42bfdf6..bde9e98 100644
--- a/bin/varnishtest/vtc_process.c
+++ b/bin/varnishtest/vtc_process.c
@@ -339,7 +339,8 @@ process_start(struct process *p)
 		assert(dup2(fd2[1], STDERR_FILENO) == STDERR_FILENO);
 		VSUB_closefrom(STDERR_FILENO + 1);
 		AZ(setpgid(0, 0));
-		AZ(execl("/bin/sh", "/bin/sh", "-c", VSB_data(cl), NULL));
+		// Not using NULL because GCC is now even more demented...
+		AZ(execl("/bin/sh", "/bin/sh", "-c", VSB_data(cl), (char*)0));
 		exit(1);
 	}
 	vtc_log(p->vl, 3, "PID: %ld", (long)p->pid);


More information about the varnish-commit mailing list