]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tools: restore lxc-create log behavior 2395/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 11 Jun 2018 11:15:48 +0000 (13:15 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 11 Jun 2018 11:16:40 +0000 (13:16 +0200)
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 <christian.brauner@ubuntu.com>
src/lxc/tools/lxc_create.c

index 3dd2e01b816e0cfc51d501b91dd016260b143312..f8ec5ad2b9cae2cf11f33196c926a2dedd290cef 100644 (file)
@@ -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;