From 10082c15c4d26c1d10a45369128f2059ec187271 Mon Sep 17 00:00:00 2001 From: phk Date: Sun, 21 Dec 2008 18:42:48 +0000 Subject: [PATCH] Minor polishing for the benefit of Glorius Checker of Code FlexeLint. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3497 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_center.c | 14 ++++++-------- varnish-cache/bin/varnishd/varnishd.c | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/varnish-cache/bin/varnishd/cache_center.c b/varnish-cache/bin/varnishd/cache_center.c index e16ecc36..88435779 100644 --- a/varnish-cache/bin/varnishd/cache_center.c +++ b/varnish-cache/bin/varnishd/cache_center.c @@ -298,7 +298,6 @@ cnt_error(struct sess *sp) { struct worker *w; struct http *h; - time_t now; char date[40]; CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); @@ -322,8 +321,7 @@ cnt_error(struct sess *sp) 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 @@ cnt_hit(struct sess *sp) return (0); default: WRONG("Illegal action in vcl_hit{}"); - return (0); } } @@ -671,10 +668,8 @@ cnt_miss(struct sess *sp) return (0); case VCL_RET_RESTART: INCOMPL(); - return (0); default: WRONG("Illegal action in vcl_miss{}"); - return (0); } } @@ -849,7 +844,6 @@ cnt_recv(struct sess *sp) return (0); default: WRONG("Illegal action in vcl_recv{}"); - return (0); } } @@ -1025,11 +1019,15 @@ cli_debug_xid(struct cli *cli, const char * const *av, void *priv) 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); diff --git a/varnish-cache/bin/varnishd/varnishd.c b/varnish-cache/bin/varnishd/varnishd.c index ce53ed9a..c3dd3314 100644 --- a/varnish-cache/bin/varnishd/varnishd.c +++ b/varnish-cache/bin/varnishd/varnishd.c @@ -543,7 +543,7 @@ main(int argc, char * const *argv) argv += optind; if (argc != 0) { - fprintf(stderr, "Too many arguments\n"); + fprintf(stderr, "Too many arguments (%s...)\n", argv[0]); usage(); } -- 2.39.5