r3497 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Sun Dec 21 19:42:48 CET 2008


Author: phk
Date: 2008-12-21 19:42:48 +0100 (Sun, 21 Dec 2008)
New Revision: 3497

Modified:
   trunk/varnish-cache/bin/varnishd/cache_center.c
   trunk/varnish-cache/bin/varnishd/varnishd.c
Log:
Minor polishing for the benefit of Glorius Checker of Code FlexeLint.



Modified: trunk/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_center.c	2008-12-21 18:41:43 UTC (rev 3496)
+++ trunk/varnish-cache/bin/varnishd/cache_center.c	2008-12-21 18:42:48 UTC (rev 3497)
@@ -298,7 +298,6 @@
 {
 	struct worker *w;
 	struct http *h;
-	time_t now;
 	char date[40];
 
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
@@ -322,8 +321,7 @@
 
 	http_PutProtocol(w, sp->fd, h, "HTTP/1.1");
 	http_PutStatus(w, sp->fd, h, sp->err_code);
-	now = TIM_real();
-	TIM_format(now, date);
+	TIM_format(TIM_real(), date);
 	http_PrintfHeader(w, sp->fd, h, "Date: %s", date);
 	http_PrintfHeader(w, sp->fd, h, "Server: Varnish");
 	http_PrintfHeader(w, sp->fd, h, "Retry-After: %d", params->err_ttl);
@@ -537,7 +535,6 @@
 		return (0);
 	default:
 		WRONG("Illegal action in vcl_hit{}");
-		return (0);
 	}
 }
 
@@ -671,10 +668,8 @@
 		return (0);
 	case VCL_RET_RESTART:
 		INCOMPL();
-		return (0);
 	default:
 		WRONG("Illegal action in vcl_miss{}");
-		return (0);
 	}
 }
 
@@ -849,7 +844,6 @@
 		return (0);
 	default:
 		WRONG("Illegal action in vcl_recv{}");
-		return (0);
 	}
 }
 
@@ -1025,11 +1019,15 @@
 	cli_out(cli, "XID is %u", xids);
 }
 
+/*
+ * Default to seed=1, this is the only seed value POSIXl guarantees will
+ * result in a reproducible random number sequence.
+ */
 static void
 cli_debug_srandom(struct cli *cli, const char * const *av, void *priv)
 {
 	(void)priv;
-	unsigned long seed;
+	unsigned seed = 1;
 
 	if (av[2] != NULL)
 		seed = strtoul(av[2], NULL, 0);

Modified: trunk/varnish-cache/bin/varnishd/varnishd.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/varnishd.c	2008-12-21 18:41:43 UTC (rev 3496)
+++ trunk/varnish-cache/bin/varnishd/varnishd.c	2008-12-21 18:42:48 UTC (rev 3497)
@@ -543,7 +543,7 @@
 	argv += optind;
 
 	if (argc != 0) {
-		fprintf(stderr, "Too many arguments\n");
+		fprintf(stderr, "Too many arguments (%s...)\n", argv[0]);
 		usage();
 	}
 



More information about the varnish-commit mailing list