[master] 4438bf4 Allow a single '\n' after the PID

Poul-Henning Kamp phk at FreeBSD.org
Wed Mar 28 14:24:16 UTC 2018


commit 4438bf419db814842534247c8aaa0284592f865a
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Mar 28 14:15:33 2018 +0000

    Allow a single '\n' after the PID

diff --git a/lib/libvarnish/vpf.c b/lib/libvarnish/vpf.c
index 915a028..cf326fb 100644
--- a/lib/libvarnish/vpf.c
+++ b/lib/libvarnish/vpf.c
@@ -89,6 +89,8 @@ VPF_read(const char *path, pid_t *pidptr)
 		return (error);
 	else if (i == 0)
 		return (EAGAIN);
+	if (i > 0 && buf[i - 1] == '\n')
+		i--;
 	buf[i] = '\0';
 
 	*pidptr = strtol(buf, &endptr, 10);


More information about the varnish-commit mailing list