Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Missing includes.
[simgrid.git] / examples / simdag / daxload / sd_daxload.c
index ed2eb41..c2fb9ed 100644 (file)
@@ -1,6 +1,6 @@
 /* simple test trying to load a DAX file.                                   */
 
-/* Copyright (c) 2009-2015. The SimGrid Team.
+/* Copyright (c) 2009-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -8,8 +8,8 @@
 
 #include "simgrid/simdag.h"
 #include "xbt/file.h"
+
 #include <stdio.h>
-#include <string.h>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Logging specific to this SimDag example");
 
@@ -44,7 +44,7 @@ int main(int argc, char **argv)
   if (!dax){
     XBT_ERROR("A problem occurred during DAX parsing (cycle or syntax). Do not continue this test");
     free(tracefilename);
-    SD_exit();
+
     exit(255);
   }
 
@@ -81,7 +81,9 @@ int main(int argc, char **argv)
   XBT_INFO("------------------- Run the schedule ---------------------------");
   SD_simulate(-1);
   XBT_INFO("------------------- Produce the trace file---------------------------");
-  XBT_INFO("Producing the trace of the run into %s", xbt_basename(tracefilename));
+  char * basename = xbt_basename(tracefilename);
+  XBT_INFO("Producing the trace of the run into %s", basename);
+  free(basename);
   FILE *out = fopen(tracefilename, "w");
   xbt_assert(out, "Cannot write to %s", tracefilename);
   free(tracefilename);
@@ -101,13 +103,12 @@ int main(int argc, char **argv)
               sg_host_get_name(wsl[0]), SD_task_get_amount(task), SD_task_get_name(task));
       break;
     default:
-      xbt_die("Task %s is of unknown kind %d", SD_task_get_name(task), SD_task_get_kind(task));
+      xbt_die("Task %s is of unknown kind %u", SD_task_get_name(task), SD_task_get_kind(task));
     }
     SD_task_destroy(task);
   }
   fclose(out);
   xbt_dynar_free_container(&dax);
 
-  SD_exit();
   return 0;
 }