1
1

check for valid mmap file before cleaning up

This commit was SVN r3715.
Этот коммит содержится в:
Tim Woodall 2004-12-06 19:41:11 +00:00
родитель 0d68912417
Коммит d595837d5d

Просмотреть файл

@ -189,22 +189,24 @@ int mca_ptl_sm_component_close(void)
OBJ_DESTRUCT(&mca_ptl_sm_component.sm_pending_ack);
/* unmap the shared memory control structure */
return_value=munmap(mca_ptl_sm_component.mmap_file->map_addr,
mca_ptl_sm_component.mmap_file->map_size);
if(-1 == return_value) {
return_value=OMPI_ERROR;
ompi_output(0," munmap failed :: file - %s :: errno - %d \n",
mca_ptl_sm_component.mmap_file->map_addr,
errno);
goto CLEANUP;
if(mca_ptl_sm_component.mmap_file != NULL) {
return_value=munmap(mca_ptl_sm_component.mmap_file->map_addr,
mca_ptl_sm_component.mmap_file->map_size);
if(-1 == return_value) {
return_value=OMPI_ERROR;
ompi_output(0," munmap failed :: file - %s :: errno - %d \n",
mca_ptl_sm_component.mmap_file->map_addr,
errno);
goto CLEANUP;
}
/* unlink file, so that it will be deleted when all references
* to it are gone - no error checking, since we want all procs
* to call this, so that in an abnormal termination scanario,
* this file will still get cleaned up */
unlink(mca_ptl_sm_component.mmap_file->map_path);
}
/* unlink file, so that it will be deleted when all references
* to it are gone - no error checking, since we want all procs
* to call this, so that in an abnormal termination scanario,
* this file will still get cleaned up */
unlink(mca_ptl_sm_component.mmap_file->map_path);
CLEANUP:
/* return */