[master] 683cc92 varnishadm: Handle EINTR from poll

Tollef Fog Heen tfheen at varnish-cache.org
Mon Feb 4 12:33:34 CET 2013


commit 683cc929be04d8693e005eb298bc0c9d5eb13f7d
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 e353d7f..bfcdf9d 100644
--- a/bin/varnishadm/varnishadm.c
+++ b/bin/varnishadm/varnishadm.c
@@ -230,6 +230,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