Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : abort if popen failed
authorMarion Guthmuller <marion.guthmuller@loria.fr>
Tue, 20 Nov 2012 15:17:14 +0000 (16:17 +0100)
committerMarion Guthmuller <marion.guthmuller@loria.fr>
Tue, 20 Nov 2012 15:17:14 +0000 (16:17 +0100)
src/mc/mc_checkpoint.c
src/mc/mc_global.c

index d816cdb..7959f8a 100644 (file)
@@ -297,8 +297,10 @@ void get_libsimgrid_plt_section(){
 
   fp = popen(command, "r");
 
 
   fp = popen(command, "r");
 
-  if(fp == NULL)
+  if(fp == NULL){
     perror("popen failed");
     perror("popen failed");
+    xbt_abort();
+  }
 
   while ((read = getline(&line, &n, fp)) != -1 && plt_not_found == 1) {
 
 
   while ((read = getline(&line, &n, fp)) != -1 && plt_not_found == 1) {
 
@@ -353,8 +355,10 @@ void get_binary_plt_section(){
 
   fp = popen(command, "r");
 
 
   fp = popen(command, "r");
 
-  if(fp == NULL)
+  if(fp == NULL){
     perror("popen failed");
     perror("popen failed");
+    xbt_abort();
+  }
 
   while ((read = getline(&line, &n, fp)) != -1 && plt_not_found == 1) {
 
 
   while ((read = getline(&line, &n, fp)) != -1 && plt_not_found == 1) {
 
index ae9f437..edc9339 100644 (file)
@@ -913,8 +913,10 @@ xbt_dict_t MC_get_location_list(const char *elf_file){
 
   FILE *fp = popen(command, "r");
 
 
   FILE *fp = popen(command, "r");
 
-  if(fp == NULL)
+  if(fp == NULL){
     perror("popen for objdump failed");
     perror("popen for objdump failed");
+    xbt_abort();
+  }
 
   int debug = 0; /*Detect if the program has been compiled with -g */
 
 
   int debug = 0; /*Detect if the program has been compiled with -g */
 
@@ -1013,8 +1015,11 @@ char *get_libsimgrid_path(){
   char *command = bprintf("ldd %s", xbt_binary_name);
   
   FILE *fp = popen(command, "r");
   char *command = bprintf("ldd %s", xbt_binary_name);
   
   FILE *fp = popen(command, "r");
-  if(fp == NULL)
+
+  if(fp == NULL){
     perror("popen for ldd failed");
     perror("popen for ldd failed");
+    xbt_abort();
+  }
 
   char *line;
   ssize_t read;
 
   char *line;
   ssize_t read;