From: Christian Brauner Date: Mon, 11 Jun 2018 11:15:48 +0000 (+0200) Subject: tools: restore lxc-create log behavior X-Git-Tag: lxc-3.1.0~256^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2395%2Fhead;p=thirdparty%2Flxc.git tools: restore lxc-create log behavior Older versions of lxc-create used to set log_file to "none" when a log priority but no log file was specified on the command line. Let's restore this behavior. Closes #2392. Signed-off-by: Christian Brauner --- diff --git a/src/lxc/tools/lxc_create.c b/src/lxc/tools/lxc_create.c index 3dd2e01b8..f8ec5ad2b 100644 --- a/src/lxc/tools/lxc_create.c +++ b/src/lxc/tools/lxc_create.c @@ -230,7 +230,10 @@ int main(int argc, char *argv[]) /* 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; + if (!my_args.log_file) + log.file = "none"; + else + log.file = my_args.log_file; log.level = my_args.log_priority; log.prefix = my_args.progname; log.quiet = my_args.quiet;