@@ -508,7 +508,7 @@ static void _toolconn(int sd, short args, void *cbdata)
508508 size_t n ;
509509 pmix_data_buffer_t * buf ;
510510 prte_plm_cmd_flag_t command = PRTE_PLM_ALLOC_JOBID_CMD ;
511- pmix_status_t xrc ;
511+ pmix_status_t xrc = PMIX_SUCCESS , trc ;
512512 bool primary = false;
513513 bool nspace_given = false;
514514 bool rank_given = false;
@@ -528,22 +528,14 @@ static void _toolconn(int sd, short args, void *cbdata)
528528 } else if (PMIX_CHECK_KEY (& cd -> info [n ], PMIX_VERSION_INFO )) {
529529 /* we ignore this for now */
530530 } else if (PMIX_CHECK_KEY (& cd -> info [n ], PMIX_USERID )) {
531- PMIX_VALUE_GET_NUMBER (xrc , & cd -> info [n ].value , cd -> uid , uid_t );
532- if (PMIX_SUCCESS != xrc ) {
533- if (NULL != cd -> toolcbfunc ) {
534- cd -> toolcbfunc (xrc , NULL , cd -> cbdata );
535- }
536- PMIX_RELEASE (cd );
537- return ;
531+ PMIX_VALUE_GET_NUMBER (trc , & cd -> info [n ].value , cd -> uid , uid_t );
532+ if (PMIX_SUCCESS == xrc && PMIX_SUCCESS != trc ) {
533+ xrc = trc ;
538534 }
539535 } else if (PMIX_CHECK_KEY (& cd -> info [n ], PMIX_GRPID )) {
540- PMIX_VALUE_GET_NUMBER (xrc , & cd -> info [n ].value , cd -> gid , gid_t );
541- if (PMIX_SUCCESS != xrc ) {
542- if (NULL != cd -> toolcbfunc ) {
543- cd -> toolcbfunc (xrc , NULL , cd -> cbdata );
544- }
545- PMIX_RELEASE (cd );
546- return ;
536+ PMIX_VALUE_GET_NUMBER (trc , & cd -> info [n ].value , cd -> gid , gid_t );
537+ if (PMIX_SUCCESS == xrc && PMIX_SUCCESS != trc ) {
538+ xrc = trc ;
547539 }
548540 } else if (PMIX_CHECK_KEY (& cd -> info [n ], PMIX_NSPACE )) {
549541 PMIX_LOAD_NSPACE (cd -> target .nspace , cd -> info [n ].value .data .string );
@@ -562,18 +554,22 @@ static void _toolconn(int sd, short args, void *cbdata)
562554 } else if (PMIX_CHECK_KEY (& cd -> info [n ], PMIX_PRIMARY_SERVER )) {
563555 primary = PMIX_INFO_TRUE (& cd -> info [n ]);
564556 } else if (PMIX_CHECK_KEY (& cd -> info [n ], PMIX_PROC_PID )) {
565- PMIX_VALUE_GET_NUMBER (xrc , & cd -> info [n ].value , cd -> pid , pid_t );
566- if (PMIX_SUCCESS != xrc ) {
567- if (NULL != cd -> toolcbfunc ) {
568- cd -> toolcbfunc (xrc , NULL , cd -> cbdata );
569- }
570- PMIX_RELEASE (cd );
571- return ;
557+ PMIX_VALUE_GET_NUMBER (trc , & cd -> info [n ].value , cd -> pid , pid_t );
558+ if (PMIX_SUCCESS == xrc && PMIX_SUCCESS != trc ) {
559+ xrc = trc ;
572560 }
573561 }
574562 }
575563 }
576564
565+ if (PMIX_SUCCESS != xrc ) {
566+ if (NULL != cd -> toolcbfunc ) {
567+ cd -> toolcbfunc (xrc , & cd -> target , cd -> cbdata );
568+ }
569+ PMIX_RELEASE (cd );
570+ return ;
571+ }
572+
577573 pmix_output_verbose (2 , prte_pmix_server_globals .output ,
578574 "%s %s CONNECTION FROM UID %d GID %d NSPACE %s" ,
579575 PRTE_NAME_PRINT (PRTE_PROC_MY_NAME ),
0 commit comments