From b40ad21be7ae73b3daa39f626c00bed2587622dd Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Thu, 16 Jun 2016 16:40:28 +0200 Subject: [PATCH] [SMPI] die() if memory map is not readable. --- src/xbt/memory_map.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/xbt/memory_map.cpp b/src/xbt/memory_map.cpp index 56349c4d4a..cd1ca7b996 100644 --- a/src/xbt/memory_map.cpp +++ b/src/xbt/memory_map.cpp @@ -34,9 +34,10 @@ XBT_PRIVATE std::vector get_memory_map(pid_t pid) /* to be returned. */ char* path = bprintf("/proc/%i/maps", (int) pid); FILE *fp = std::fopen(path, "r"); - if(fp == nullptr) + if (fp == nullptr) { std::perror("fopen failed"); - xbt_assert(fp, "Cannot open %s to investigate the memory map of the process.", path); + xbt_die("Cannot open %s to investigate the memory map of the process.", path); + } free(path); setbuf(fp, nullptr); -- 2.20.1