From: Arnaud Giersch Date: Wed, 18 May 2011 12:25:27 +0000 (+0200) Subject: [tesh] Don't define variables twice. X-Git-Tag: v3_6_rc3~24 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c1279242e832ddcc53bf8ceb0e112035f64a844d [tesh] Don't define variables twice. Declare them "extern" in include file. Found by compiling with "-fno-common". --- 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 */