[6.0] a9d3d695a Clear vut->sighup even if sighup_f is not defined

Martin Blix Grydeland martin at varnish-software.com
Tue Nov 9 15:41:05 UTC 2021


commit a9d3d695a019176cf30cbd7e4457fad46a6aa24c
Author: Emanuele Rocca <ema at wikimedia.org>
Date:   Wed Oct 14 15:14:31 2020 +0200

    Clear vut->sighup even if sighup_f is not defined
    
    Fixes #3437

diff --git a/lib/libvarnishapi/vut.c b/lib/libvarnishapi/vut.c
index b02644a81..60c36d349 100644
--- a/lib/libvarnishapi/vut.c
+++ b/lib/libvarnishapi/vut.c
@@ -364,12 +364,15 @@ VUT_Main(struct VUT *vut)
 	AN(vut->vslq);
 
 	while (!vut->sigint) {
-		if (vut->sighup && vut->sighup_f) {
-			/* sighup callback */
+		if (vut->sighup) {
 			vut->sighup = 0;
-			i = vut->sighup_f(vut);
-			if (i)
-				break;
+
+			if (vut->sighup_f) {
+				/* sighup callback */
+				i = vut->sighup_f(vut);
+				if (i)
+					break;
+			}
 		}
 
 		if (vut->sigusr1) {


More information about the varnish-commit mailing list