2020-03-01 22:54:01 -05:00
|
|
|
From 819a1a3a4badd6f794cc161199eb2446a2325cdf Mon Sep 17 00:00:00 2001
|
2019-09-30 11:03:07 -04:00
|
|
|
From: liuhao <liuhao27@huawei.com>
|
|
|
|
|
Date: Mon, 17 Jun 2019 20:17:37 +0800
|
2020-03-01 22:54:01 -05:00
|
|
|
Subject: [PATCH 107/140] add log for failure of rename file
|
2019-09-30 11:03:07 -04:00
|
|
|
|
|
|
|
|
1. add log message of rename operator
|
|
|
|
|
2. if rename console file failed, reopen terminal fd
|
|
|
|
|
|
|
|
|
|
Signed-off-by: liuhao <liuhao27@huawei.com>
|
|
|
|
|
Signed-off-by: LiFeng <lifeng68@huawei.com>
|
|
|
|
|
---
|
|
|
|
|
src/lxc/terminal.c | 5 +++--
|
|
|
|
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
|
|
diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c
|
2020-01-05 22:20:49 -05:00
|
|
|
index a8a0dc9..778a0ab 100644
|
2019-09-30 11:03:07 -04:00
|
|
|
--- a/src/lxc/terminal.c
|
|
|
|
|
+++ b/src/lxc/terminal.c
|
|
|
|
|
@@ -293,8 +293,9 @@ static int lxc_terminal_rotate_log_file(struct lxc_terminal *terminal)
|
|
|
|
|
close(terminal->log_fd);
|
|
|
|
|
terminal->log_fd = -1;
|
|
|
|
|
ret = lxc_unpriv(rename(terminal->log_path, tmp));
|
|
|
|
|
- if (ret < 0)
|
|
|
|
|
- return ret;
|
|
|
|
|
+ if (ret < 0) {
|
|
|
|
|
+ SYSERROR("Rename container log file failed");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
return lxc_terminal_create_log_file(terminal);
|
|
|
|
|
}
|
|
|
|
|
--
|
2020-01-05 22:20:49 -05:00
|
|
|
1.8.3.1
|
2019-09-30 11:03:07 -04:00
|
|
|
|