From 89962c6c0c1f0d6f3b19401c5fbb87e6ead25421 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Tue, 27 Feb 2018 21:42:18 +0100 Subject: [PATCH] console: always dump log file Signed-off-by: Christian Brauner --- src/lxc/console.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/lxc/console.c b/src/lxc/console.c index 55b925e0c..a893aba07 100644 --- a/src/lxc/console.c +++ b/src/lxc/console.c @@ -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; -- 2.47.2