From: mquinson Date: Thu, 5 Jul 2007 16:56:46 +0000 (+0000) Subject: It can happen that users put the call to MSG_config before the one to MSG_init (hello... X-Git-Tag: v3.3~1698 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/7bd78e067ea14ae8cef3817272fbc4c632f5bd00 It can happen that users put the call to MSG_config before the one to MSG_init (hello Pedro ;). Check this and fail gracefully in that case. A yet better solution would be to initialize stuff in that case, but MSG don't like getting arguments (through MSG_init) after it's initialized so it seems really hard git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3662 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/msg/msg_config.c b/src/msg/msg_config.c index 811d1b5931..7685c1af92 100644 --- a/src/msg/msg_config.c +++ b/src/msg/msg_config.c @@ -23,8 +23,14 @@ * Example: * MSG_config("surf_workstation_model","KCCFLN05"); */ -void MSG_config(const char *name, ...) -{ +void MSG_config(const char *name, ...) { + + if (!msg_global) { + fprintf(stderr, "ERROR: Please call MSG_init() before using MSG_config()\n"); + abort(); + } + + va_list pa; /* xbt_cfg_dump("msg_cfg_set","",_msg_cfg_set);*/ va_start(pa,name);