Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 21 additions & 16 deletions opal/mca/base/mca_base_var.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Copyright (c) 2004-2012 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
Expand All @@ -17,9 +17,9 @@
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
*
* Additional copyrights may follow
*
*
* $HEADER$
*/

Expand Down Expand Up @@ -140,7 +140,7 @@ static int var_value_string (mca_base_var_t *var, char **value_string);
*/
static void var_constructor (mca_base_var_t *p);
static void var_destructor (mca_base_var_t *p);
OBJ_CLASS_INSTANCE(mca_base_var_t, opal_object_t,
OBJ_CLASS_INSTANCE(mca_base_var_t, opal_object_t,
var_constructor, var_destructor);

static void fv_constructor (mca_base_var_file_value_t *p);
Expand Down Expand Up @@ -190,7 +190,7 @@ static int compare_strings (const char *str1, const char *str2) {
if ((NULL != str1 && 0 == strcmp (str1, "*")) ||
(NULL == str1 && NULL == str2)) {
return 0;
}
}

if (NULL != str1 && NULL != str2) {
return strcmp (str1, str2);
Expand Down Expand Up @@ -265,7 +265,7 @@ int mca_base_var_init(void)

/* Set this before we register the parameter, below */

mca_base_var_initialized = true;
mca_base_var_initialized = true;

mca_base_var_cache_files(false);

Expand Down Expand Up @@ -404,7 +404,7 @@ static int mca_base_var_cache_files(bool rel_path_search)

/* We may need this later */
home = (char*)opal_home_directory();

if(NULL == cwd) {
cwd = (char *) malloc(sizeof(char) * MAXPATHLEN);
if( NULL == (cwd = getcwd(cwd, MAXPATHLEN) )) {
Expand Down Expand Up @@ -598,7 +598,7 @@ static int var_set_string (mca_base_var_t *var, char *value)
return OPAL_SUCCESS;
}

/* Replace all instances of ~/ in a path-style string with the
/* Replace all instances of ~/ in a path-style string with the
user's home directory. This may be handled by the enumerator
in the future. */
if (0 == strncmp (value, "~/", 2)) {
Expand Down Expand Up @@ -850,7 +850,7 @@ static int var_get (int vari, mca_base_var_t **var_out, bool original)
*var_out = NULL;
}

/* Check for bozo cases */
/* Check for bozo cases */
if (!mca_base_var_initialized) {
return OPAL_ERROR;
}
Expand Down Expand Up @@ -945,7 +945,7 @@ static int var_find (const char *project_name, const char *framework_name,
* Find the index for an MCA parameter based on its name components.
*/
int mca_base_var_find (const char *project_name, const char *framework_name,
const char *component_name, const char *variable_name)
const char *component_name, const char *variable_name)
{
return var_find (project_name, framework_name, component_name, variable_name, false);
}
Expand Down Expand Up @@ -1003,7 +1003,7 @@ int mca_base_var_build_env(char ***env, int *num_env, bool internal)
int ret;

/* Check for bozo cases */

if (!mca_base_var_initialized) {
return OPAL_ERROR;
}
Expand Down Expand Up @@ -1626,7 +1626,7 @@ static int var_set_from_env (mca_base_var_t *var)
bool is_synonym = VAR_IS_SYNONYM(var[0]);
char *source_env, *value_env;
int ret;

if (is_synonym) {
ret = var_get (var->mbv_synonym_for, &var, true);
if (OPAL_SUCCESS != ret) {
Expand Down Expand Up @@ -1750,7 +1750,7 @@ static int var_set_from_file (mca_base_var_t *var, opal_list_t *file_values)
/* found it */
if (VAR_IS_DEFAULT_ONLY(var[0])) {
opal_show_help("help-mca-var.txt", "default-only-param-set",
true, var_full_name);
true, var_full_name);

return OPAL_ERR_NOT_FOUND;
}
Expand Down Expand Up @@ -1960,7 +1960,7 @@ static int var_value_string (mca_base_var_t *var, char **value_string)
break;
case MCA_BASE_VAR_TYPE_STRING:
case MCA_BASE_VAR_TYPE_VERSION_STRING:
ret = asprintf (value_string, "%s",
ret = asprintf (value_string, "%s",
value->stringval ? value->stringval : "");
break;
case MCA_BASE_VAR_TYPE_BOOL:
Expand Down Expand Up @@ -2033,7 +2033,7 @@ int mca_base_var_check_exclusive (const char *project,
str_b = source_name(var_b);

/* Print it all out */
opal_show_help("help-mca-var.txt",
opal_show_help("help-mca-var.txt",
"mutually-exclusive-vars",
true, var_a->mbv_full_name,
str_a, var_b->mbv_full_name,
Expand Down Expand Up @@ -2124,7 +2124,12 @@ int mca_base_var_dump(int vari, char ***out, mca_base_var_dump_type_t output_typ
full_name);

/* Output the value */
asprintf(out[0] + line++, "%svalue:%s", tmp, value_string);
char *colon = strchr(value_string, ':');
if (NULL != colon) {
asprintf(out[0] + line++, "%svalue:\"%s\"", tmp, value_string);
} else {
asprintf(out[0] + line++, "%svalue:%s", tmp, value_string);
}

/* Output the source */
asprintf(out[0] + line++, "%ssource:%s", tmp, source_string);
Expand Down
Loading