Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
correcting the return value for the TRACE_start function
authorschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 7 Apr 2010 12:38:26 +0000 (12:38 +0000)
committerschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 7 Apr 2010 12:38:26 +0000 (12:38 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7463 48e7efb5-ca39-0410-a469-dd3cf9ba447f

include/instr/instr.h
src/instr/interface.c

index 8b87e2f..3615359 100644 (file)
@@ -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);
index 4dc5d80..1c5cf1a 100644 (file)
@@ -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)