[experimental-ims] d81cc9b Always exit if no socket could be connected

Geoff Simmons geoff at varnish-cache.org
Fri Jul 8 11:47:34 CEST 2011


commit d81cc9b5f4a1d960d6375f67b6cd0a71bbb8f565
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Thu Jun 9 14:00:09 2011 +0200

    Always exit if no socket could be connected

diff --git a/bin/varnishadm/varnishadm.c b/bin/varnishadm/varnishadm.c
index 46273bc..151a437 100644
--- a/bin/varnishadm/varnishadm.c
+++ b/bin/varnishadm/varnishadm.c
@@ -349,16 +349,14 @@ main(int argc, char * const *argv)
 			usage();
 		}
 		sock = n_arg_sock(n_arg);
-		if (sock < 0)
-			exit(2);
 	} else if (T_arg == NULL) {
 		sock = n_arg_sock("");
-		if (sock < 0)
-			exit(2);
 	} else {
 		assert(T_arg != NULL);
 		sock = cli_sock(T_arg, S_arg);
 	}
+	if (sock < 0)
+		exit(2);
 
 	if (argc > 0)
 		do_args(sock, argc, argv);



More information about the varnish-commit mailing list