Skip to content

Commit

Permalink
tools: lxc-unshare: apply default log priority
Browse files Browse the repository at this point in the history
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
  • Loading branch information
2xsec authored and Christian Brauner committed Aug 12, 2018
1 parent d9a381b commit dcaf464
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/lxc/tools/lxc_unshare.c
Expand Up @@ -102,6 +102,8 @@ Options :\n\
.options = my_longopts,
.parser = my_parser,
.checker = NULL,
.log_priority = "ERROR",
.log_file = "none",
.daemonize = 0,
.pidfile = NULL,
};
Expand Down Expand Up @@ -325,19 +327,16 @@ int main(int argc, char *argv[])
if (lxc_arguments_parse(&my_args, argc, argv))
exit(EXIT_FAILURE);

/* Only create log if explicitly instructed */
if (my_args.log_file || my_args.log_priority) {
log.name = my_args.name;
log.file = my_args.log_file;
log.level = my_args.log_priority;
log.prefix = my_args.progname;
log.quiet = my_args.quiet;
log.lxcpath = my_args.lxcpath[0];
log.name = my_args.name;
log.file = my_args.log_file;
log.level = my_args.log_priority;
log.prefix = my_args.progname;
log.quiet = my_args.quiet;
log.lxcpath = my_args.lxcpath[0];

if (lxc_log_init(&log)) {
free_ifname_list();
exit(EXIT_FAILURE);
}
if (lxc_log_init(&log)) {
free_ifname_list();
exit(EXIT_FAILURE);
}

if (!*my_args.argv) {
Expand Down

0 comments on commit dcaf464

Please sign in to comment.