27 lines
939 B
Diff
27 lines
939 B
Diff
From 8eee379351a1c81f41c62c6416c29bb7b6af5968 Mon Sep 17 00:00:00 2001
|
|
From: TanYifeng <tanyifeng1@huawei.com>
|
|
Date: Tue, 3 Dec 2019 22:43:25 -0500
|
|
Subject: [PATCH 127/139] log: only write (size - begin) if buffer is full
|
|
|
|
Signed-off-by: TanYifeng <tanyifeng1@huawei.com>
|
|
---
|
|
src/lxc/terminal.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c
|
|
index e81f57e..b547013 100644
|
|
--- a/src/lxc/terminal.c
|
|
+++ b/src/lxc/terminal.c
|
|
@@ -538,7 +538,7 @@ static int lxc_terminal_write_log_file(struct lxc_terminal *terminal, const char
|
|
* noting that it's a partial log line. */
|
|
if (buf == NULL || (begin == 0 && size == __BUF_CACHE_SIZE)) {
|
|
if (begin < size) {
|
|
- ret = lxc_logger_write(terminal, type, cache + begin, index - begin + 1);
|
|
+ ret = lxc_logger_write(terminal, type, cache + begin, size - begin);
|
|
if (ret < 0) {
|
|
WARN("Failed to log msg");
|
|
}
|
|
--
|
|
1.8.3.1
|
|
|