Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI] die() if memory map is not readable.
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Thu, 16 Jun 2016 14:40:28 +0000 (16:40 +0200)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Fri, 17 Jun 2016 09:27:40 +0000 (11:27 +0200)
src/xbt/memory_map.cpp

index 56349c4..cd1ca7b 100644 (file)
@@ -34,9 +34,10 @@ XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
   /* to be returned. */
   char* path = bprintf("/proc/%i/maps", (int) pid);
   FILE *fp = std::fopen(path, "r");
   /* 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");
     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);
 
   free(path);
   setbuf(fp, nullptr);