Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't use xbt_assert for error checking, it may be disabled.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 5 May 2014 12:15:12 +0000 (14:15 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 5 May 2014 12:38:59 +0000 (14:38 +0200)
src/msg/msg_actions.c
src/smpi/smpi_base.c
src/surf/trace_mgr.c
src/xbt/xbt_replay.c

index 6ebb522..434b254 100644 (file)
@@ -44,8 +44,8 @@ msg_error_t MSG_action_trace_run(char *path)
   action_fp=NULL;  
   if (path) {
     action_fp = fopen(path, "r");
   action_fp=NULL;  
   if (path) {
     action_fp = fopen(path, "r");
-    xbt_assert(action_fp != NULL, "Cannot open %s: %s", path,
-                strerror(errno));
+    if (action_fp == NULL)
+      xbt_die("Cannot open %s: %s", path, strerror(errno));
   }
   res = MSG_main();
 
   }
   res = MSG_main();
 
index 4b5fe09..cc9e409 100644 (file)
@@ -260,8 +260,8 @@ void smpi_action_trace_run(char *path)
   action_fp=NULL;
   if (path) {
     action_fp = fopen(path, "r");
   action_fp=NULL;
   if (path) {
     action_fp = fopen(path, "r");
-    xbt_assert(action_fp != NULL, "Cannot open %s: %s", path,
-               strerror(errno));
+    if (action_fp == NULL)
+      xbt_die("Cannot open %s: %s", path, strerror(errno));
   }
 
   if (!xbt_dict_is_empty(action_queues)) {
   }
 
   if (!xbt_dict_is_empty(action_queues)) {
index 8f44eaa..2f0478f 100644 (file)
@@ -339,8 +339,9 @@ tmgr_trace_t tmgr_trace_new_from_file(const char *filename)
   }
 
   f = surf_fopen(filename, "r");
   }
 
   f = surf_fopen(filename, "r");
-  xbt_assert(f != NULL, "Cannot open file '%s' (path=%s)", filename,
-              xbt_str_join(surf_path, ":"));
+  if (f == NULL)
+    xbt_die("Cannot open file '%s' (path=%s)", filename,
+            xbt_str_join(surf_path, ":"));
 
   tstr = xbt_str_from_file(f);
   fclose(f);
 
   tstr = xbt_str_from_file(f);
   fclose(f);
index ffd8002..f3a9fbc 100644 (file)
@@ -52,8 +52,8 @@ xbt_replay_reader_t xbt_replay_reader_new(const char *filename)
 {
   xbt_replay_reader_t res = xbt_new0(s_xbt_replay_reader_t,1);
   res->fp = fopen(filename, "r");
 {
   xbt_replay_reader_t res = xbt_new0(s_xbt_replay_reader_t,1);
   res->fp = fopen(filename, "r");
-  xbt_assert(res->fp != NULL, "Cannot open %s: %s", filename,
-      strerror(errno));
+  if (res->fp == NULL)
+    xbt_die("Cannot open %s: %s", filename, strerror(errno));
   res->filename = xbt_strdup(filename);
   return res;
 }
   res->filename = xbt_strdup(filename);
   return res;
 }