1010 * Copyright (c) 2004-2005 The Regents of the University of California.
1111 * All rights reserved.
1212 * Copyright (c) 2006-2013 Cisco Systems, Inc. All rights reserved.
13- * Copyright (c) 2015 Research Organization for Information Science
13+ * Copyright (c) 2015-2017 Research Organization for Information Science
1414 * and Technology (RIST). All rights reserved.
1515 * $COPYRIGHT$
1616 *
@@ -78,6 +78,7 @@ int MPI_Unpack(const void *inbuf, int insize, int *position,
7878
7979
8080 if ( insize > 0 ) {
81+ int ret ;
8182 OBJ_CONSTRUCT ( & local_convertor , opal_convertor_t );
8283 /* the resulting convertor will be set the the position ZERO */
8384 opal_convertor_copy_and_prepare_for_recv ( ompi_mpi_local_convertor , & (datatype -> super ),
@@ -96,15 +97,15 @@ int MPI_Unpack(const void *inbuf, int insize, int *position,
9697
9798 /* Do the actual unpacking */
9899 iov_count = 1 ;
99- rc = opal_convertor_unpack ( & local_convertor , & outvec , & iov_count , & size );
100+ ret = opal_convertor_unpack ( & local_convertor , & outvec , & iov_count , & size );
100101 * position += size ;
101102 OBJ_DESTRUCT ( & local_convertor );
102- } else {
103- rc = 1 ;
103+ /* All done. Note that the convertor returns 1 upon success, not
104+ OPAL_SUCCESS. */
105+ if (1 != ret ) {
106+ rc = OMPI_ERROR ;
107+ }
104108 }
105109
106- /* All done. Note that the convertor returns 1 upon success, not
107- OMPI_SUCCESS. */
108- OMPI_ERRHANDLER_RETURN ((rc == 1 ) ? OMPI_SUCCESS : OMPI_ERROR ,
109- comm , MPI_ERR_UNKNOWN , FUNC_NAME );
110+ OMPI_ERRHANDLER_RETURN (rc , comm , MPI_ERR_UNKNOWN , FUNC_NAME );
110111}
0 commit comments