r1596 - trunk/varnish-cache/bin/varnishtop

des at projects.linpro.no des at projects.linpro.no
Fri Jun 29 12:04:12 CEST 2007


Author: des
Date: 2007-06-29 12:04:12 +0200 (Fri, 29 Jun 2007)
New Revision: 1596

Modified:
   trunk/varnish-cache/bin/varnishtop/varnishtop.c
Log:
Simplify.


Modified: trunk/varnish-cache/bin/varnishtop/varnishtop.c
===================================================================
--- trunk/varnish-cache/bin/varnishtop/varnishtop.c	2007-06-29 10:03:55 UTC (rev 1595)
+++ trunk/varnish-cache/bin/varnishtop/varnishtop.c	2007-06-29 10:04:12 UTC (rev 1596)
@@ -276,16 +276,11 @@
 {
 	struct VSL_data *vd;
 	const char *n_arg = NULL;
-	int i, o, once = 0;
+	int o, once = 0;
 
 	vd = VSL_New();
 
 	while ((o = getopt(argc, argv, VSL_ARGS "1fn:V")) != -1) {
-		i = VSL_Arg(vd, o, optarg);
-		if (i < 0)
-			exit (1);
-		if (i > 0)
-			continue;
 		switch (o) {
 		case '1':
 			VSL_Arg(vd, 'd', NULL);
@@ -301,6 +296,8 @@
 			varnish_version("varnishtop");
 			exit(0);
 		default:
+			if (VSL_Arg(vd, o, optarg) > 0)
+				break;
 			usage();
 		}
 	}




More information about the varnish-commit mailing list