[3.0] 91921da Don't assert on sleep failure due to signals in VSL library (some utils expect to receive SIGHUP).

Tollef Fog Heen tfheen at varnish-cache.org
Tue Aug 9 11:06:45 CEST 2011


commit 91921da1082fb36d610752077ddb2466259e541c
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Fri Jul 8 16:30:06 2011 +0200

    Don't assert on sleep failure due to signals in VSL library (some
    utils expect to receive SIGHUP).
    
    Fixes: #947

diff --git a/lib/libvarnishapi/vsl.c b/lib/libvarnishapi/vsl.c
index 2b3b45e..4141c28 100644
--- a/lib/libvarnishapi/vsl.c
+++ b/lib/libvarnishapi/vsl.c
@@ -184,7 +184,7 @@ vsl_nextlog(struct vsl *vsl, uint32_t **pp)
 			if (vsl->flags & F_NON_BLOCKING)
 				return (-1);
 			w += SLEEP_USEC;
-			AZ(usleep(SLEEP_USEC));
+			assert(usleep(SLEEP_USEC) == 0 || errno == EINTR);
 			continue;
 		}
 		*pp = (void*)(uintptr_t)vsl->log_ptr; /* Loose volatile */



More information about the varnish-commit mailing list