Skip to content
Snippets Groups Projects
Commit 31fc6e03 authored by Jeff Squyres's avatar Jeff Squyres
Browse files

opal_wrapper: consolidate extra variable name


We don't need to have two variables: one named exec_command and one
named exec_cmd.  Consolidate down to just a single variable
(exec_command), and in doing so, fix a compiler warning that
exec_command may not have been initialized (due to confusion between
exec_command and exec_cmd).

Also remove some #if 0/dead code.

Signed-off-by: default avatarJeff Squyres <jsquyres@cisco.com>
parent 2ef23001
Branches
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved. * University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * All rights reserved.
* Copyright (c) 2007-2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2007-2021 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights * Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
* reserved. * reserved.
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
...@@ -940,14 +940,9 @@ int main(int argc, char *argv[]) ...@@ -940,14 +940,9 @@ int main(int argc, char *argv[])
if (flags & COMP_DRY_RUN) { if (flags & COMP_DRY_RUN) {
exec_command = opal_argv_join(exec_argv, ' '); exec_command = opal_argv_join(exec_argv, ' ');
printf("%s\n", exec_command); printf("%s\n", exec_command);
free(exec_command);
} else { } else {
char *tmp; char *tmp;
#if 0
exec_command = opal_argv_join(exec_argv, ' ');
printf("command: %s\n", exec_command);
#endif
tmp = opal_path_findv(exec_argv[0], 0, environ, NULL); tmp = opal_path_findv(exec_argv[0], 0, environ, NULL);
if (NULL == tmp) { if (NULL == tmp) {
opal_show_help("help-opal-wrapper.txt", "no-compiler-found", true, exec_argv[0], NULL); opal_show_help("help-opal-wrapper.txt", "no-compiler-found", true, exec_argv[0], NULL);
...@@ -964,17 +959,12 @@ int main(int argc, char *argv[]) ...@@ -964,17 +959,12 @@ int main(int argc, char *argv[])
? WTERMSIG(status) ? WTERMSIG(status)
: (WIFSTOPPED(status) ? WSTOPSIG(status) : 255)); : (WIFSTOPPED(status) ? WSTOPSIG(status) : 255));
if ((OPAL_SUCCESS != ret) || ((0 != exit_status) && (flags & COMP_SHOW_ERROR))) { if ((OPAL_SUCCESS != ret) || ((0 != exit_status) && (flags & COMP_SHOW_ERROR))) {
char* exec_cmd = opal_argv_join(exec_argv, ' ');
if (OPAL_SUCCESS != ret) { if (OPAL_SUCCESS != ret) {
exec_command = opal_argv_join(exec_argv, ' ');
opal_show_help("help-opal-wrapper.txt", "spawn-failed", true, exec_argv[0], opal_show_help("help-opal-wrapper.txt", "spawn-failed", true, exec_argv[0],
strerror(status), exec_command, NULL); strerror(status), exec_command, NULL);
} else { free(exec_command);
#if 0
opal_show_help("help-opal-wrapper.txt", "compiler-failed", true,
exec_argv[0], exit_status, exec_cmd, NULL);
#endif
} }
free(exec_cmd);
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment