[master] 861606d3f Also reset global cmds like barrier

Poul-Henning Kamp phk at FreeBSD.org
Fri Mar 15 09:44:07 UTC 2019


commit 861606d3f3f7fb0ada893eac9392073d367f9acc
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Mar 15 09:42:17 2019 +0000

    Also reset global cmds like barrier

diff --git a/bin/varnishtest/vtc.c b/bin/varnishtest/vtc.c
index f6c686d17..be6c85aa1 100644
--- a/bin/varnishtest/vtc.c
+++ b/bin/varnishtest/vtc.c
@@ -65,6 +65,8 @@ vtc_vrnd_unlock(void)
 	AZ(pthread_mutex_unlock(&vtc_vrnd_mtx));
 }
 
+static const char *tfn;
+
 /**********************************************************************
  * Macro facility
  */
@@ -79,6 +81,18 @@ struct macro {
 
 static VTAILQ_HEAD(,macro) macro_list = VTAILQ_HEAD_INITIALIZER(macro_list);
 
+static const struct cmds global_cmds[] = {
+#define CMD_GLOBAL(n) { #n, cmd_##n },
+#include "cmds.h"
+	{ NULL, NULL }
+};
+
+static const struct cmds cmds[] = {
+#define CMD_TOP(n) { #n, cmd_##n },
+#include "cmds.h"
+	{ NULL, NULL }
+};
+
 /**********************************************************************/
 
 static struct macro *
@@ -290,12 +304,6 @@ macro_expand(struct vtclog *vl, const char *text)
  * Static checkers like Coverity may bitch about this, but we don't care.
  */
 
-static const struct cmds global_cmds[] = {
-#define CMD_GLOBAL(n) { #n, cmd_##n },
-#include "cmds.h"
-	{ NULL, NULL }
-};
-
 
 void
 parse_string(const char *spec, const struct cmds *cmd, void *priv,
@@ -448,14 +456,6 @@ reset_cmds(const struct cmds *cmd)
  * Execute a file
  */
 
-static const struct cmds cmds[] = {
-#define CMD_TOP(n) { #n, cmd_##n },
-#include "cmds.h"
-	{ NULL, NULL }
-};
-
-static const char *tfn;
-
 int
 fail_out(void)
 {
@@ -470,6 +470,7 @@ fail_out(void)
 	if (!vtc_stop)
 		vtc_stop = 1;
 	vtc_log(vltop, 1, "RESETTING after %s", tfn);
+	reset_cmds(global_cmds);
 	reset_cmds(cmds);
 	vtc_error |= old_err;
 


More information about the varnish-commit mailing list