Commit 0322077d authored by Mike Rapoport's avatar Mike Rapoport Committed by Andrei Vagin

criu/config: rename variables counting options in config files

s/first_count/global_cfg_argc
s/second_count/user_cfg_argc
Signed-off-by: 's avatarMike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent b65c7919
......@@ -184,7 +184,7 @@ static void init_configuration(int argc, char *argv[], int defaults_forbidden)
}
}
void init_config(int argc, char **argv, int *first_count, int *second_count)
void init_config(int argc, char **argv, int *global_cfg_argc, int *user_cfg_argc)
{
int help_or_configs;
bool usage_error;
......@@ -198,7 +198,7 @@ void init_config(int argc, char **argv, int *first_count, int *second_count)
init_configuration(argc, argv, (help_or_configs == DEFAULT_CONFIGS_FORBIDDEN));
if (global_conf != NULL)
*first_count = count_elements(global_conf);
*global_cfg_argc = count_elements(global_conf);
if (user_conf != NULL)
*second_count = count_elements(user_conf);
*user_cfg_argc = count_elements(user_conf);
}
......@@ -273,7 +273,7 @@ int main(int argc, char *argv[], char *envp[])
bool has_exec_cmd = false;
bool has_sub_command;
int opt = 0, idx;
int first_count = 1, second_count = 1;
int global_cfg_argc = 0, user_cfg_argc = 0;
int state = PARSING_GLOBAL_CONF;
int log_level = DEFAULT_LOGLEVEL;
char *imgs_dir = ".";
......@@ -395,17 +395,17 @@ int main(int argc, char *argv[], char *envp[])
return cr_service_work(atoi(argv[2]));
}
init_config(argc, argv, &first_count, &second_count);
init_config(argc, argv, &global_cfg_argc, &user_cfg_argc);
while (1) {
idx = -1;
switch (state) {
case PARSING_GLOBAL_CONF:
opt = getopt_long(first_count, global_conf, short_opts, long_opts, &idx);
opt = getopt_long(global_cfg_argc, global_conf, short_opts, long_opts, &idx);
break;
case PARSING_USER_CONF:
opt = getopt_long(second_count, user_conf, short_opts, long_opts, &idx);
opt = getopt_long(user_cfg_argc, user_conf, short_opts, long_opts, &idx);
break;
case PARSING_ARGV:
opt = getopt_long(argc, argv, short_opts, long_opts, &idx);
......
......@@ -32,7 +32,8 @@ extern int cr_lazy_pages(bool daemon);
extern int check_add_feature(char *arg);
extern void pr_check_features(const char *offset, const char *sep, int width);
extern void init_config(int argc, char **argv, int *first_cnt, int *second_cnt);
extern void init_config(int argc, char **argv,
int *global_cfg_argc, int *user_cfg_argc);
#define PPREP_HEAD_INACTIVE ((struct pprep_head *)-1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment