From c95e96a60c6d7abed9fefba1076976a4fbe16ded Mon Sep 17 00:00:00 2001 From: schnorr Date: Wed, 7 Apr 2010 12:38:26 +0000 Subject: [PATCH 1/1] correcting the return value for the TRACE_start function git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7463 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- include/instr/instr.h | 1 + src/instr/interface.c | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/instr/instr.h b/include/instr/instr.h index 8b87e2ff5a..3615359c56 100644 --- a/include/instr/instr.h +++ b/include/instr/instr.h @@ -33,6 +33,7 @@ #define TRACE_ERROR_CATEGORY_ALREADY_DEFINED 301 #define TRACE_ERROR_MASK 400 #define TRACE_ERROR_FILE_OPEN 401 +#define TRACE_ERROR_START 500 XBT_PUBLIC(int) TRACE_start_with_mask (const char *filename, int mask); XBT_PUBLIC(int) TRACE_end (void); diff --git a/src/instr/interface.c b/src/instr/interface.c index 4dc5d80b20..1c5cf1a106 100644 --- a/src/instr/interface.c +++ b/src/instr/interface.c @@ -30,7 +30,7 @@ int trace_mask; * * \param name of the file that will contain the traces * \param mask to take into account during trace - * \return 1 if everything is ok, 0 otherwise + * \return 0 if everything is ok */ int TRACE_start_with_mask(const char *filename, int mask) { if (IS_TRACING) { /* what? trace is already active... ignore.. */ @@ -47,7 +47,7 @@ int TRACE_start_with_mask(const char *filename, int mask) { FILE *file = fopen(filename, "w"); if (!file) { - THROW1 (tracing_error, TRACE_ERROR_FILE_OPEN, + THROW1 (tracing_error, TRACE_ERROR_START, "Tracefile %s could not be opened for writing.", filename); } else { TRACE_paje_start (file); @@ -100,15 +100,15 @@ int TRACE_start_with_mask(const char *filename, int mask) { __TRACE_surf_init(); __TRACE_msg_process_init (); - return 1; + return 0; } int TRACE_end() { - if (!IS_TRACING) return 0; + if (!IS_TRACING) return 1; __TRACE_surf_finalize(); FILE *file = TRACE_paje_end(); fclose (file); - return 1; + return 0; } void TRACE_category (const char *category) -- 2.20.1