[master] aa23821f6 SQUASHME: Address Dridis nitpicks

Nils Goroll nils.goroll at uplex.de
Mon Jul 3 08:55:09 UTC 2023


commit aa23821f6ff703894d58853377f377b6babc6d4d
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Thu Jun 29 16:12:08 2023 +0200

    SQUASHME: Address Dridis nitpicks

diff --git a/bin/varnishd/mgt/mgt_child.c b/bin/varnishd/mgt/mgt_child.c
index 188cad7bc..53918825b 100644
--- a/bin/varnishd/mgt/mgt_child.c
+++ b/bin/varnishd/mgt/mgt_child.c
@@ -310,6 +310,7 @@ mgt_launch_child(struct cli *cli)
 	int i, cp[2];
 	struct rlimit rl[1];
 	vtim_dur dstart;
+	int bstart;
 	vtim_mono t0;
 
 	if (child_state != CH_STOPPED && child_state != CH_DIED)
@@ -439,10 +440,10 @@ mgt_launch_child(struct cli *cli)
 	AN(child_std_vlu);
 
 	/* Wait for cache/cache_cli.c::CLI_Run() to check in */
-	dstart = vmax(mgt_param.startup_timeout, mgt_param.cli_timeout);
+	bstart = mgt_param.startup_timeout >= mgt_param.cli_timeout;
+	dstart = bstart ? mgt_param.startup_timeout : mgt_param.cli_timeout;
 	t0 = VTIM_mono();
 	if (VCLI_ReadResult(child_cli_in, &u, NULL, dstart)) {
-		int bstart = mgt_param.startup_timeout >= mgt_param.cli_timeout;
 		assert(u == CLIS_COMMS);
 		if (VTIM_mono() - t0 < dstart)
 			mgt_launch_err(cli, u, "Child failed on launch ");
diff --git a/bin/varnishtest/tests/r03940.vtc b/bin/varnishtest/tests/r03940.vtc
index 1213330c5..febc602ec 100644
--- a/bin/varnishtest/tests/r03940.vtc
+++ b/bin/varnishtest/tests/r03940.vtc
@@ -16,8 +16,8 @@ varnish v1 -expectexit 0x40
 process p1 { varnishd \
 	-sdebug=debug,dinit=5s \
 	-pstartup_timeout=3s -pcli_timeout=2s \
-	-n ${tmpdir}/p1 -a :0 -b none 2>&1 } -start
-process p1 -expect-exit 0x2 -wait
+	-n ${tmpdir}/p1 -a :0 -b none 2>&1
+} -expect-exit 0x2 -run
 process p1 -expect-text 0 0 \
 	"Child failed on launch within startup_timeout=3.00s"
 
@@ -36,8 +36,8 @@ varnish v2 -expectexit 0x40
 process p2 { varnishd \
 	-sdebug=debug,dopen=5s \
 	-pstartup_timeout=2s -pcli_timeout=3s \
-	-n ${tmpdir}/p2 -a :0 -b none} -start
-process p2 -expect-exit 0x2 -wait
+	-n ${tmpdir}/p2 -a :0 -b none
+} -expect-exit 0x2 -run
 
 # expect-text does not work here because the panic info pushes the
 # error out of the emulated terminal's view.


More information about the varnish-commit mailing list