From: Marion Guthmuller Date: Tue, 20 Nov 2012 15:17:14 +0000 (+0100) Subject: model-checker : abort if popen failed X-Git-Tag: v3_9_rc1~91^2~63 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2cc294d3e6a633bd4a76a41ce98f053290b41623?hp=d0c5cc5a4f87a98928093830eab689dcdd0dd603 model-checker : abort if popen failed --- diff --git a/src/mc/mc_checkpoint.c b/src/mc/mc_checkpoint.c index d816cdb70a..7959f8a999 100644 --- a/src/mc/mc_checkpoint.c +++ b/src/mc/mc_checkpoint.c @@ -297,8 +297,10 @@ void get_libsimgrid_plt_section(){ fp = popen(command, "r"); - if(fp == NULL) + if(fp == NULL){ perror("popen failed"); + xbt_abort(); + } while ((read = getline(&line, &n, fp)) != -1 && plt_not_found == 1) { @@ -353,8 +355,10 @@ void get_binary_plt_section(){ fp = popen(command, "r"); - if(fp == NULL) + if(fp == NULL){ perror("popen failed"); + xbt_abort(); + } while ((read = getline(&line, &n, fp)) != -1 && plt_not_found == 1) { diff --git a/src/mc/mc_global.c b/src/mc/mc_global.c index ae9f437c1d..edc9339637 100644 --- a/src/mc/mc_global.c +++ b/src/mc/mc_global.c @@ -913,8 +913,10 @@ xbt_dict_t MC_get_location_list(const char *elf_file){ FILE *fp = popen(command, "r"); - if(fp == NULL) + if(fp == NULL){ perror("popen for objdump failed"); + xbt_abort(); + } 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"); - if(fp == NULL) + + if(fp == NULL){ perror("popen for ldd failed"); + xbt_abort(); + } char *line; ssize_t read;