Commit d5e7b0e3 authored by Philip Carns's avatar Philip Carns

bug fix, error checking on open()

parent a3cf7959
...@@ -603,7 +603,7 @@ static void* custom_mmap_alloc(const char* filename, size_t size, int rank) ...@@ -603,7 +603,7 @@ static void* custom_mmap_alloc(const char* filename, size_t size, int rank)
sprintf(local_filename, "%s.%d", filename, rank); sprintf(local_filename, "%s.%d", filename, rank);
fd = open(local_filename, O_CREAT|O_EXCL|O_RDWR, S_IRUSR|S_IWUSR); fd = open(local_filename, O_CREAT|O_EXCL|O_RDWR, S_IRUSR|S_IWUSR);
if(!fd) if(fd<0)
{ {
perror("creat"); perror("creat");
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