r3686 - branches/2.0/varnish-cache/bin/varnishd

tfheen at projects.linpro.no tfheen at projects.linpro.no
Fri Feb 6 15:58:27 CET 2009


Author: tfheen
Date: 2009-02-06 15:58:26 +0100 (Fri, 06 Feb 2009)
New Revision: 3686

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



Modified: branches/2.0/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- branches/2.0/varnish-cache/bin/varnishd/cache_center.c	2009-02-06 14:54:27 UTC (rev 3685)
+++ branches/2.0/varnish-cache/bin/varnishd/cache_center.c	2009-02-06 14:58:26 UTC (rev 3686)
@@ -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: branches/2.0/varnish-cache/bin/varnishd/varnishd.c
===================================================================
--- branches/2.0/varnish-cache/bin/varnishd/varnishd.c	2009-02-06 14:54:27 UTC (rev 3685)
+++ branches/2.0/varnish-cache/bin/varnishd/varnishd.c	2009-02-06 14:58:26 UTC (rev 3686)
@@ -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