Skip to content

Commit f6fd676

Browse files
committed
Merge pull request #1638 from jsquyres/pr/ompi-file-info-fix
ompio: always return valid info from FILE_GET_INFO
2 parents 4899c89 + f167be1 commit f6fd676

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
@@ -600,14 +601,14 @@ int mca_io_ompio_file_get_info (ompi_file_t *fh,
600601
int ret = OMPI_SUCCESS;
601602
ompi_info_t *info=NULL;
602603

603-
if ( MPI_INFO_NULL == fh->f_info ) {
604-
*info_used = MPI_INFO_NULL;
604+
info = OBJ_NEW(ompi_info_t);
605+
if (NULL == info) {
606+
return MPI_ERR_INFO;
605607
}
606-
else {
607-
info = OBJ_NEW(ompi_info_t);
608+
if (MPI_INFO_NULL != fh->f_info) {
608609
ret = ompi_info_dup (fh->f_info, &info);
609-
*info_used = info;
610610
}
611+
*info_used = info;
611612

612613
return ret;
613614
}

0 commit comments

Comments
 (0)