[master] 3a0d628 Don't assert on sleep failure due to signals in VSL library (some utils expect to receive SIGHUP).

Martin Blix Grydeland martin at varnish-cache.org
Mon Jul 11 09:55:48 CEST 2011


commit 3a0d628c1e2dff4b7a15253739f7cecdff8ec19c
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