13
13
* Copyright (c) 2012-2016 Los Alamos National Security, LLC. All rights
14
14
* reserved.
15
15
* Copyright (c) 2012-2015 Cisco Systems, Inc. All rights reserved.
16
- * Copyright (c) 2015 Research Organization for Information Science
16
+ * Copyright (c) 2015-2017 Research Organization for Information Science
17
17
* and Technology (RIST). All rights reserved.
18
18
* Copyright (c) 2016 Intel, Inc. All rights reserved
19
19
* $COPYRIGHT$
35
35
#include "opal/util/argv.h"
36
36
#include "opal/util/cmd_line.h"
37
37
#include "opal/util/output.h"
38
+ #include "opal/util/opal_environ.h"
38
39
39
40
#include "opal/mca/base/mca_base_var.h"
40
41
#include "opal/constants.h"
@@ -1158,7 +1159,6 @@ static int set_dest(cmd_line_option_t *option, char *sval)
1158
1159
{
1159
1160
int ival = atol (sval );
1160
1161
long lval = strtoul (sval , NULL , 10 );
1161
- char * str = NULL ;
1162
1162
size_t i ;
1163
1163
1164
1164
/* Set MCA param. We do this in the environment because the MCA
@@ -1176,17 +1176,14 @@ static int set_dest(cmd_line_option_t *option, char *sval)
1176
1176
case OPAL_CMD_LINE_TYPE_STRING :
1177
1177
case OPAL_CMD_LINE_TYPE_INT :
1178
1178
case OPAL_CMD_LINE_TYPE_SIZE_T :
1179
- asprintf ( & str , "%s=%s" , option -> clo_mca_param_env_var , sval );
1179
+ opal_setenv ( option -> clo_mca_param_env_var , sval , true, & environ );
1180
1180
break ;
1181
1181
case OPAL_CMD_LINE_TYPE_BOOL :
1182
- asprintf ( & str , "%s= 1" , option -> clo_mca_param_env_var );
1182
+ opal_setenv ( option -> clo_mca_param_env_var , "1" , true, & environ );
1183
1183
break ;
1184
1184
default :
1185
1185
break ;
1186
1186
}
1187
- if (NULL != str ) {
1188
- putenv (str );
1189
- }
1190
1187
}
1191
1188
1192
1189
/* Set variable */
0 commit comments