Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 3cbaa38

Browse files
committed
Merge pull request #1142 from jsquyres/pr/v2.0.0/fix-ompi-file-info
ompio: always return valid info from FILE_GET_INFO
2 parents 74d8ea0 + 2e5429c commit 3cbaa38

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

ompi/mca/io/ompio/io_ompio_file_open.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Copyright (c) 2008-2015 University of Houston. All rights reserved.
1313
* Copyright (c) 2015 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -599,14 +600,14 @@ int mca_io_ompio_file_get_info (ompi_file_t *fh,
599600
int ret = OMPI_SUCCESS;
600601
ompi_info_t *info=NULL;
601602

602-
if ( MPI_INFO_NULL == fh->f_info ) {
603-
*info_used = MPI_INFO_NULL;
603+
info = OBJ_NEW(ompi_info_t);
604+
if (NULL == info) {
605+
return MPI_ERR_INFO;
604606
}
605-
else {
606-
info = OBJ_NEW(ompi_info_t);
607+
if (MPI_INFO_NULL != fh->f_info) {
607608
ret = ompi_info_dup (fh->f_info, &info);
608-
*info_used = info;
609609
}
610+
*info_used = info;
610611

611612
return ret;
612613
}

0 commit comments

Comments
 (0)