[3.0] 677d34f varnishadm: Handle EINTR from poll

Tollef Fog Heen tfheen at varnish-cache.org
Mon Apr 22 13:27:01 CEST 2013


commit 677d34f4b307a5276fa1adf6ad737983f869e279
Author: Tollef Fog Heen <tfheen at varnish-software.com>
Date:   Mon Feb 4 12:32:20 2013 +0100

    varnishadm: Handle EINTR from poll
    
    poll can return EINTR, so we need to handle that.
    
    Fixes: #1166

diff --git a/bin/varnishadm/varnishadm.c b/bin/varnishadm/varnishadm.c
index 043aa38..1787d8e 100644
--- a/bin/varnishadm/varnishadm.c
+++ b/bin/varnishadm/varnishadm.c
@@ -223,6 +223,9 @@ pass(int sock)
 	fds[1].events = POLLIN;
 	while (1) {
 		i = poll(fds, 2, -1);
+		if (i == -1 && errno == EINTR) {
+			continue;
+		}
 		assert(i > 0);
 		if (fds[0].revents & POLLIN) {
 			/* Get rid of the prompt, kinda hackish */



More information about the varnish-commit mailing list