Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
allow several hosts to open the same file simultaneously
[simgrid.git] / src / mc / mc_checkpoint.c
index cd2beff86eb29174fb94d1ca37a999741cf3f048..3e96454766daa048f241479d1fcc0969507c75b3 100644 (file)
@@ -88,6 +88,8 @@ static mc_mem_region_t MC_region_new(int type, void *start_addr, size_t size)
   new_reg->start_addr = start_addr;
   new_reg->size = size;
   new_reg->data = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
+  if(new_reg->data==MAP_FAILED)
+    xbt_die("Could not mmap new memory for snapshot.");
   memcpy(new_reg->data, start_addr, size);
   madvise(new_reg->data, size, MADV_MERGEABLE);