Commit a3cf7959 authored by Philip Carns's avatar Philip Carns

bug fix: posix_fallocate() returns error directly

parent 12443c86
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include <errno.h>
#include <mpi.h> #include <mpi.h>
...@@ -611,6 +612,7 @@ static void* custom_mmap_alloc(const char* filename, size_t size, int rank) ...@@ -611,6 +612,7 @@ static void* custom_mmap_alloc(const char* filename, size_t size, int rank)
ret = posix_fallocate(fd, 0, size); ret = posix_fallocate(fd, 0, size);
if(ret != 0) if(ret != 0)
{ {
errno = ret;
perror("posix_fallocate"); perror("posix_fallocate");
return(NULL); return(NULL);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment