mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-18 00:58:31 +00:00
crtools: init logfile after processing all command line arguments
I see no need now to init log during processing of command line arguments. Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com> Acked-by: Andrew Vagin <avagin@parallels.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
6b8f651f5f
commit
401680e85b
1 changed files with 2 additions and 9 deletions
11
crtools.c
11
crtools.c
|
|
@ -77,7 +77,6 @@ int main(int argc, char *argv[])
|
|||
pid_t pid = 0, tree_id = 0;
|
||||
int ret = -1;
|
||||
int opt, idx;
|
||||
int log_inited = 0;
|
||||
int log_level = 0;
|
||||
|
||||
BUILD_BUG_ON(PAGE_SIZE != PAGE_IMAGE_SIZE);
|
||||
|
|
@ -171,9 +170,6 @@ int main(int argc, char *argv[])
|
|||
break;
|
||||
case 'o':
|
||||
opts.output = optarg;
|
||||
if (log_init(optarg))
|
||||
return -1;
|
||||
log_inited = 1;
|
||||
break;
|
||||
case 'n':
|
||||
if (parse_ns_string(optarg))
|
||||
|
|
@ -286,11 +282,8 @@ int main(int argc, char *argv[])
|
|||
|
||||
log_set_loglevel(log_level);
|
||||
|
||||
if (!log_inited) {
|
||||
ret = log_init(NULL);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
if (log_init(opts.output))
|
||||
return -1;
|
||||
|
||||
if (opts.img_parent)
|
||||
pr_info("Will do snapshot from %s\n", opts.img_parent);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue