[prev in list] [next in list] [prev in thread] [next in thread] 

List:       varnish-commit
Subject:    [master] 4438bf4 Allow a single '\n' after the PID
From:       Poul-Henning Kamp <phk () FreeBSD ! org>
Date:       2018-03-28 14:24:16
Message-ID: 20180328142416.8C263B3269 () lists ! varnish-cache ! org
[Download RAW message or body]


commit 4438bf419db814842534247c8aaa0284592f865a
Author: Poul-Henning Kamp <phk@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);
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic