@@ -357,7 +357,7 @@ static int setup_launch(int *argcptr, char ***argvptr, char *nodename, int *node
357357 prte_plm_ssh_shell_t remote_shell , local_shell ;
358358 int orted_argc ;
359359 char * * orted_argv ;
360- char * orted_cmd , * orted_prefix , * final_cmd ;
360+ char * orted_cmd , * orted_prefix , * final_cmd , * daemon_name ;
361361 int orted_index ;
362362 int rc ;
363363 int i ;
@@ -635,7 +635,12 @@ static int setup_launch(int *argcptr, char ***argvptr, char *nodename, int *node
635635 * with the prefix directory
636636 */
637637 if (NULL != orted_cmd ) {
638- if (0 == strcmp (orted_cmd , "prted" )) {
638+ #ifdef PRTE_BINARY_PREFIX
639+ pmix_asprintf (& daemon_name , "%s%s" , PRTE_BINARY_PREFIX , "prted" );
640+ #else
641+ daemon_name = strdup ("prted" );
642+ #endif
643+ if (0 == strcmp (orted_cmd , daemon_name )) {
639644 /* if the cmd is our standard one, then add the prefix */
640645 value = pmix_basename (prte_install_dirs .bindir );
641646 if ('/' == prefix_dir [strlen (prefix_dir )- 1 ]) {
@@ -650,6 +655,7 @@ static int setup_launch(int *argcptr, char ***argvptr, char *nodename, int *node
650655 /* someone specified something different, so don't prefix it */
651656 full_orted_cmd = strdup (orted_cmd );
652657 }
658+ free (daemon_name );
653659 free (orted_cmd );
654660 } else {
655661 /* use our standard one and add the prefix */
0 commit comments