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-2016 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 *
@@ -79,6 +79,7 @@ int MPI_Unpack(const void *inbuf, int insize, int *position,
7979 OPAL_CR_ENTER_LIBRARY ();
8080
8181 if ( insize > 0 ) {
82+ int ret ;
8283 OBJ_CONSTRUCT ( & local_convertor , opal_convertor_t );
8384 /* the resulting convertor will be set the the position ZERO */
8485 opal_convertor_copy_and_prepare_for_recv ( ompi_mpi_local_convertor , & (datatype -> super ),
@@ -98,17 +99,17 @@ int MPI_Unpack(const void *inbuf, int insize, int *position,
9899
99100 /* Do the actual unpacking */
100101 iov_count = 1 ;
101- rc = opal_convertor_unpack ( & local_convertor , & outvec , & iov_count , & size );
102+ ret = opal_convertor_unpack ( & local_convertor , & outvec , & iov_count , & size );
102103 * position += size ;
103104 OBJ_DESTRUCT ( & local_convertor );
104- } else {
105- rc = 1 ;
105+ /* All done. Note that the convertor returns 1 upon success, not
106+ OPAL_SUCCESS. */
107+ if (1 != ret ) {
108+ rc = OMPI_ERROR ;
109+ }
106110 }
107111
108112 OPAL_CR_EXIT_LIBRARY ();
109113
110- /* All done. Note that the convertor returns 1 upon success, not
111- OMPI_SUCCESS. */
112- OMPI_ERRHANDLER_RETURN ((rc == 1 ) ? OMPI_SUCCESS : OMPI_ERROR ,
113- comm , MPI_ERR_UNKNOWN , FUNC_NAME );
114+ OMPI_ERRHANDLER_RETURN (rc , comm , MPI_ERR_UNKNOWN , FUNC_NAME );
114115}
0 commit comments