Check for the presence of setenv. If it is present, then use it in opal_setenv when setting values in the environ
Этот коммит содержится в:
родитель
07263889d5
Коммит
907b4606c5
@ -867,7 +867,7 @@ OPAL_SEARCH_LIBS_CORE([dirname], [gen])
|
|||||||
# Darwin doesn't need -lm, as it's a symlink to libSystem.dylib
|
# Darwin doesn't need -lm, as it's a symlink to libSystem.dylib
|
||||||
OPAL_SEARCH_LIBS_CORE([ceil], [m])
|
OPAL_SEARCH_LIBS_CORE([ceil], [m])
|
||||||
|
|
||||||
AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf openpty isatty getpwuid fork waitpid execve pipe ptsname setsid mmap tcgetpgrp posix_memalign strsignal sysconf syslog vsyslog regcmp regexec regfree _NSGetEnviron socketpair strncpy_s usleep mkfifo dbopen dbm_open statfs statvfs setpgid])
|
AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf openpty isatty getpwuid fork waitpid execve pipe ptsname setsid mmap tcgetpgrp posix_memalign strsignal sysconf syslog vsyslog regcmp regexec regfree _NSGetEnviron socketpair strncpy_s usleep mkfifo dbopen dbm_open statfs statvfs setpgid setenv])
|
||||||
|
|
||||||
# Sanity check: ensure that we got at least one of statfs or statvfs.
|
# Sanity check: ensure that we got at least one of statfs or statvfs.
|
||||||
if test $ac_cv_func_statfs = no -a $ac_cv_func_statvfs = no; then
|
if test $ac_cv_func_statfs = no -a $ac_cv_func_statvfs = no; then
|
||||||
|
@ -11,7 +11,8 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2006 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) 2014 Intel, Inc. All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -123,10 +124,15 @@ int opal_setenv(const char *name, const char *value, bool overwrite,
|
|||||||
if( *env == environ ) {
|
if( *env == environ ) {
|
||||||
/* THIS IS POTENTIALLY A MEMORY LEAK! But I am doing it
|
/* THIS IS POTENTIALLY A MEMORY LEAK! But I am doing it
|
||||||
because so that we don't violate the law of least
|
because so that we don't violate the law of least
|
||||||
astonishmet for OPAL developers (i.e., those that don't
|
astonishment for OPAL developers (i.e., those that don't
|
||||||
check the return code of opal_setenv() and notice that we
|
check the return code of opal_setenv() and notice that we
|
||||||
returned an error if you passed in the real environ) */
|
returned an error if you passed in the real environ) */
|
||||||
|
#if defined (HAVE_SETENV)
|
||||||
|
setenv(name, value, overwrite);
|
||||||
|
free(newvalue);
|
||||||
|
#else
|
||||||
putenv(newvalue);
|
putenv(newvalue);
|
||||||
|
#endif
|
||||||
return OPAL_SUCCESS;
|
return OPAL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user