From 4fc610b42e6253c348b6fcc85f41f41bf13a19ea Mon Sep 17 00:00:00 2001 From: alegrand Date: Tue, 7 Dec 2004 18:26:24 +0000 Subject: [PATCH 1/1] Initializing logs once and only once. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@552 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/surf/surf.c | 1 + src/xbt/module.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/surf/surf.c b/src/surf/surf.c index 27dfe04ec0..02e1d9631d 100644 --- a/src/surf/surf.c +++ b/src/surf/surf.c @@ -54,6 +54,7 @@ void surf_action_change_state(surf_action_t action, e_surf_action_state_t state) void surf_init(void) { + xbt_init(); if(!resource_list) resource_list = xbt_dynar_new(sizeof(surf_resource_private_t), NULL); if(!history) history = tmgr_history_new(); if(!maxmin_system) maxmin_system = lmm_system_new(); diff --git a/src/xbt/module.c b/src/xbt/module.c index d435369a7e..0c90ca5c3b 100644 --- a/src/xbt/module.c +++ b/src/xbt/module.c @@ -35,7 +35,10 @@ struct xbt_module_ { void xbt_init(int *argc, char **argv) { - xbt_init_defaultlog(argc, argv, NULL); + static int first_run = 1; + if(first_run) + xbt_init_defaultlog(argc, argv, NULL); + first_run = 0; } /** -- 2.20.1