]> git.proxmox.com Git - mirror_lxc.git/commitdiff
console: always dump log file
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 27 Feb 2018 20:42:18 +0000 (21:42 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 27 Feb 2018 20:42:18 +0000 (21:42 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/console.c

index 55b925e0cf10fc240456f7e5083acc94261c15a3..a893aba07d9c7eecfa6a7e7d350b9ac40cb7009c 100644 (file)
@@ -219,7 +219,6 @@ static int lxc_console_rotate_log_file(struct lxc_console *console)
        size_t len;
        char *tmp;
 
-       /* rotate the console log file */
        if (!console->log_path || console->log_rotate == 0)
                return -EOPNOTSUPP;
 
@@ -281,7 +280,6 @@ static int lxc_console_write_log_file(struct lxc_console *console, char *buf,
                return lxc_write_nointr(console->log_fd, buf, bytes_read);
        }
 
-       /* check how much space we have left */
        space_left = console->log_size - st.st_size;
 
        /* User doesn't want to rotate the log file and there's no more space
@@ -313,7 +311,7 @@ static int lxc_console_write_log_file(struct lxc_console *console, char *buf,
        /* Calculate how many bytes we still need to write. */
        bytes_read -= space_left;
 
-       /* There be more to write but we aren't instructed to rotate the log
+       /* There'd be more to write but we aren't instructed to rotate the log
         * file so simply return. There's no error on our side here.
         */
        if (console->log_rotate > 0)
@@ -720,10 +718,6 @@ int lxc_console_write_ringbuffer(struct lxc_console *console)
        if (console->log_size == 0)
                return 0;
 
-       /* The log file is rotated. */
-       if (console->log_rotate == 0)
-               return 0;
-
        used = lxc_ringbuf_used(buf);
        if (used == 0)
                return 0;