[master] 1c05470 Flexelinting

Poul-Henning Kamp phk at FreeBSD.org
Tue Feb 27 10:41:10 UTC 2018


commit 1c05470dfce0aae174aa21cadbf89e70658ef8a1
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Feb 27 10:21:30 2018 +0000

    Flexelinting

diff --git a/bin/varnishtop/varnishtop.c b/bin/varnishtop/varnishtop.c
index f47c514..c687376 100644
--- a/bin/varnishtop/varnishtop.c
+++ b/bin/varnishtop/varnishtop.c
@@ -382,22 +382,22 @@ main(int argc, char **argv)
 		ident = VSM_Dup(vut->vsm, "Arg", "-i");
 	else
 		ident = strdup("");
-	if (!once) {
+	vut->dispatch_f = accumulate;
+	vut->dispatch_priv = NULL;
+	vut->sighup_f = sighup;
+	if (once) {
+		VUT_Main(vut);
+		dump();
+	} else {
 		if (pthread_create(&thr, NULL, do_curses, NULL) != 0) {
 			fprintf(stderr, "pthread_create(): %s\n",
 			    strerror(errno));
 			exit(1);
 		}
+		VUT_Main(vut);
+		end_of_file = 1;
+		AZ(pthread_join(thr, NULL));
 	}
-	vut->dispatch_f = accumulate;
-	vut->dispatch_priv = NULL;
-	vut->sighup_f = sighup;
-	VUT_Main(vut);
-	end_of_file = 1;
-	if (once)
-		dump();
-	else
-		pthread_join(thr, NULL);
 	VUT_Fini(&vut);
 	exit(0);
 }


More information about the varnish-commit mailing list