[master] b6f67fb Format 0 bytes as 0b, be consistent about internal byte arguments

Nils Goroll nils.goroll at uplex.de
Mon Nov 14 10:20:05 CET 2016


commit b6f67fb7e2bd6c8d23ac7e858e7f5c75fe46c8ed
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Oct 31 18:55:23 2016 +0100

    Format 0 bytes as 0b, be consistent about internal byte arguments
    
    0 bytes are not a bogus number

diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index a31d1c7..61f8a90 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -443,12 +443,12 @@ init_params(struct cli *cli)
 #endif
 
 	low = sysconf(_SC_THREAD_STACK_MIN);
-	MCF_ParamConf(MCF_MINIMUM, "thread_pool_stack", "%jd", (intmax_t)low);
+	MCF_ParamConf(MCF_MINIMUM, "thread_pool_stack", "%jdb", (intmax_t)low);
 
 	def = 48 * 1024;
 	if (def < low)
 		def = low;
-	MCF_ParamConf(MCF_DEFAULT, "thread_pool_stack", "%jd", (intmax_t)def);
+	MCF_ParamConf(MCF_DEFAULT, "thread_pool_stack", "%jdb", (intmax_t)def);
 
 	MCF_ParamConf(MCF_MAXIMUM, "thread_pools", "%d", MAX_THREAD_POOLS);
 
diff --git a/bin/varnishd/mgt/mgt_param_tweak.c b/bin/varnishd/mgt/mgt_param_tweak.c
index d58e032..70e1c9a 100644
--- a/bin/varnishd/mgt/mgt_param_tweak.c
+++ b/bin/varnishd/mgt/mgt_param_tweak.c
@@ -223,7 +223,7 @@ fmt_bytes(struct vsb *vsb, uintmax_t t)
 {
 	const char *p;
 
-	if (t & 0xff) {
+	if (t == 0 || t & 0xff) {
 		VSB_printf(vsb, "%jub", t);
 		return;
 	}



More information about the varnish-commit mailing list