Skip to content
Snippets Groups Projects
Commit 43a5a3d1 authored by Tim Wickberg's avatar Tim Wickberg
Browse files

Move global variable initialization to definition in scontrol.

ASAN detected an issue with the uninitialized one_liner variable,
move all initialization to global variable definitions for simplicity.
parent ab480afb
No related branches found
No related tags found
No related merge requests found
...@@ -49,14 +49,14 @@ ...@@ -49,14 +49,14 @@
char *command_name; char *command_name;
List clusters = NULL; List clusters = NULL;
int all_flag; /* display even hidden partitions */ int all_flag = 0; /* display even hidden partitions */
int detail_flag; /* display additional details */ int detail_flag = 0; /* display additional details */
int exit_code; /* scontrol's exit code, =1 on any error at any time */ int exit_code = 0; /* scontrol's exit code, =1 on any error at any time */
int exit_flag; /* program to terminate if =1 */ int exit_flag = 0; /* program to terminate if =1 */
int input_words; /* number of words of input permitted */ int input_words = 128; /* number of words of input permitted */
int one_liner; /* one record per line if =1 */ int one_liner = 0; /* one record per line if =1 */
int quiet_flag; /* quiet=1, verbose=-1, normal=0 */ int quiet_flag = 0; /* quiet=1, verbose=-1, normal=0 */
int verbosity; /* count of "-v" options */ int verbosity = 0; /* count of "-v" options */
uint32_t cluster_flags; /* what type of cluster are we talking to */ uint32_t cluster_flags; /* what type of cluster are we talking to */
block_info_msg_t *old_block_info_ptr = NULL; block_info_msg_t *old_block_info_ptr = NULL;
...@@ -90,7 +90,7 @@ static void _write_config (void); ...@@ -90,7 +90,7 @@ static void _write_config (void);
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
int error_code = SLURM_SUCCESS, i, opt_char, input_field_count; int error_code = SLURM_SUCCESS, i, opt_char, input_field_count = 0;
char **input_fields, *env_val; char **input_fields, *env_val;
log_options_t opts = LOG_OPTS_STDERR_ONLY ; log_options_t opts = LOG_OPTS_STDERR_ONLY ;
...@@ -110,14 +110,7 @@ main (int argc, char *argv[]) ...@@ -110,14 +110,7 @@ main (int argc, char *argv[])
{NULL, 0, 0, 0} {NULL, 0, 0, 0}
}; };
command_name = argv[0]; command_name = argv[0];
all_flag = 0;
detail_flag = 0;
exit_code = 0;
exit_flag = 0;
input_field_count = 0;
quiet_flag = 0;
verbosity = 0;
slurm_conf_init(NULL); slurm_conf_init(NULL);
log_init("scontrol", opts, SYSLOG_FACILITY_DAEMON, NULL); log_init("scontrol", opts, SYSLOG_FACILITY_DAEMON, NULL);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment