Round up a few places where PATH_MAX was used instead of
OMPI_PATH_MAX. Thanks to Andrea Iob for the bug report. This commit was SVN r20360.
Этот коммит содержится в:
родитель
fb0e0b854a
Коммит
bb3d258562
@ -318,6 +318,9 @@ typedef long long bool;
|
||||
* Maximum size of a filename path.
|
||||
*/
|
||||
#include <limits.h>
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
#if defined(PATH_MAX)
|
||||
#define OMPI_PATH_MAX (PATH_MAX + 1)
|
||||
#elif defined(_POSIX_PATH_MAX)
|
||||
|
@ -9,6 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -330,8 +331,8 @@ char* opal_find_absolute_path( char* app_name )
|
||||
if( opal_path_is_absolute(app_name) ) { /* already absolute path */
|
||||
abs_app_name = app_name;
|
||||
} else if( '.' == app_name[0] ) { /* the app is in the current directory */
|
||||
char cwd[PATH_MAX], *pcwd;
|
||||
pcwd = getcwd( cwd, PATH_MAX );
|
||||
char cwd[OMPI_PATH_MAX], *pcwd;
|
||||
pcwd = getcwd( cwd, OMPI_PATH_MAX );
|
||||
if( NULL == pcwd ) {
|
||||
/* too bad there is no way we can get the app absolute name */
|
||||
return NULL;
|
||||
@ -343,7 +344,7 @@ char* opal_find_absolute_path( char* app_name )
|
||||
}
|
||||
|
||||
if( NULL != abs_app_name ) {
|
||||
char* resolved_path = (char*)malloc(PATH_MAX);
|
||||
char* resolved_path = (char*)malloc(OMPI_PATH_MAX);
|
||||
#if !defined(__WINDOWS__)
|
||||
realpath( abs_app_name, resolved_path );
|
||||
#else
|
||||
|
@ -12,6 +12,7 @@
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -286,9 +287,9 @@ static char **search(const char* agent_list)
|
||||
int i, j;
|
||||
char *line, **lines = opal_argv_split(agent_list, ':');
|
||||
char **tokens, *tmp;
|
||||
char cwd[PATH_MAX];
|
||||
char cwd[OMPI_PATH_MAX];
|
||||
|
||||
getcwd(cwd, PATH_MAX);
|
||||
getcwd(cwd, OMPI_PATH_MAX);
|
||||
for (i = 0; NULL != lines[i]; ++i) {
|
||||
line = lines[i];
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
* Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2007-2008 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2007-2009 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -188,7 +188,7 @@ static int process(char *orig_line, char *basename, opal_cmd_line_t *cmd_line,
|
||||
int i;
|
||||
char *line, *full_line = strdup(orig_line);
|
||||
char *user_argv, *tmp, *tmp2, **tmp_argv, **executable;
|
||||
char cwd[PATH_MAX];
|
||||
char cwd[OMPI_PATH_MAX];
|
||||
bool used_num_procs = false;
|
||||
bool single_app = false;
|
||||
bool fail_needed_executable = false;
|
||||
@ -317,7 +317,7 @@ static int process(char *orig_line, char *basename, opal_cmd_line_t *cmd_line,
|
||||
|
||||
/* Can we find argv[0] in the path? */
|
||||
|
||||
getcwd(cwd, PATH_MAX);
|
||||
getcwd(cwd, OMPI_PATH_MAX);
|
||||
tmp = opal_path_findv((*new_argv)[0], X_OK, environ, cwd);
|
||||
if (NULL != tmp) {
|
||||
free(tmp);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user