mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-29 21:38:16 +00:00
criu/config: rename variables counting options in config files
s/first_count/global_cfg_argc s/second_count/user_cfg_argc Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
4386b324b3
commit
cc101ae63b
@ -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);
|
||||
}
|
||||
|
@ -267,7 +267,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 = ".";
|
||||
@ -391,17 +391,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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user