[master] 107c4a2 Bail out of CLI reads on signals

Poul-Henning Kamp phk at FreeBSD.org
Mon Oct 24 16:55:06 CEST 2016


commit 107c4a288187d69a3d9c5e5f406a61d7b2c2cce9
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Oct 24 14:53:27 2016 +0000

    Bail out of CLI reads on signals
    
    Spotted & prodded by: 	Hermunn
    Closes: #2026

diff --git a/lib/libvarnish/vcli_proto.c b/lib/libvarnish/vcli_proto.c
index 7e52fb2..9e94fc6 100644
--- a/lib/libvarnish/vcli_proto.c
+++ b/lib/libvarnish/vcli_proto.c
@@ -119,6 +119,10 @@ read_tmo(int fd, char *ptr, unsigned len, double tmo)
 	pfd.events = POLLIN;
 	for (j = 0; len > 0; ) {
 		i = poll(&pfd, 1, to);
+		if (i < 0) {
+			errno = EINTR;
+			return (-1);
+		}
 		if (i == 0) {
 			errno = ETIMEDOUT;
 			return (-1);



More information about the varnish-commit mailing list