From c1279242e832ddcc53bf8ceb0e112035f64a844d Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 18 May 2011 14:25:27 +0200 Subject: [PATCH] [tesh] Don't define variables twice. Declare them "extern" in include file. Found by compiling with "-fno-common". --- tools/tesh/tesh.c | 5 +++++ tools/tesh/tesh.h | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/tools/tesh/tesh.c b/tools/tesh/tesh.c index cd963991e7..34c92b1351 100644 --- a/tools/tesh/tesh.c +++ b/tools/tesh/tesh.c @@ -21,8 +21,13 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(tesh, "TEst SHell utility"); /*** Options ***/ int timeout_value = 5; /* child timeout value */ int sort_len = 19; /* length of the prefix to sort */ +char *option; +rctx_t rctx; const char *testsuite_name; + +xbt_dict_t env; + static void handle_line(const char *filepos, char *line) { /* Search end */ diff --git a/tools/tesh/tesh.h b/tools/tesh/tesh.h index 326c1f5515..0dfd22b2b4 100644 --- a/tools/tesh/tesh.h +++ b/tools/tesh/tesh.h @@ -22,13 +22,13 @@ const char *signal_name(unsigned int got, char *expected); #include "run_context.h" /*** Options ***/ -int timeout_value; /* child timeout value */ -int sort_len; /* length of the prefix to sort */ -char* option; /* cfg for command line */ +extern int timeout_value; /* child timeout value */ +extern int sort_len; /* length of the prefix to sort */ +extern char* option; /* cfg for command line */ #define SORT_LEN_DEFAULT 19 -rctx_t rctx; -const char *testsuite_name; +extern rctx_t rctx; +extern const char *testsuite_name; /* Environment related definitions */ @@ -41,6 +41,6 @@ const char *testsuite_name; extern char **environ; # endif -xbt_dict_t env; /* the environment, stored as a dict (for variable substitution) */ +extern xbt_dict_t env; /* the environment, stored as a dict (for variable substitution) */ #endif /* TESH_H */ -- 2.20.1