From d066c67b531c4453091a410fccae606d63421518 Mon Sep 17 00:00:00 2001 From: Josh Hursey Date: Thu, 22 Jan 2009 19:18:36 +0000 Subject: [PATCH] We need to update both context->app and context->argv[0] with the new path when we use --preload-binary. This keeps orte from checking the wrong path later in the odls [orte_util_check_context_app() called from odls_base_default_setup_fork()]. Refs trac:1770 This commit was SVN r20321. The following Trac tickets were found above: Ticket 1770 --> https://svn.open-mpi.org/trac/ompi/ticket/1770 --- orte/mca/odls/base/odls_base_state.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/orte/mca/odls/base/odls_base_state.c b/orte/mca/odls/base/odls_base_state.c index 1b7856c25a..45e3f0fffd 100644 --- a/orte/mca/odls/base/odls_base_state.c +++ b/orte/mca/odls/base/odls_base_state.c @@ -168,15 +168,21 @@ static int orte_odls_base_preload_append_binary(orte_app_context_t* context, cleanup: /* - * Adjust the process name to point to the new local version + * Adjust the process name to point to the new local version (and argv[0]) */ if( NULL != local_bin ) { if(NULL != context->app) { free(context->app); context->app = NULL; } + if(NULL != context->argv[0]) { + free(context->argv[0]); + context->argv[0] = NULL; + } + + context->app = strdup(local_bin); + context->argv[0] = strdup(local_bin); - context->app = strdup(local_bin); free(local_bin); }