代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/lxc 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From de512a0c11bff1bfc8f0045e144bddc689742a21 Mon Sep 17 00:00:00 2001
From: LiFeng <lifeng68@huawei.com>
Date: Thu, 30 Apr 2020 16:40:14 +0800
Subject: [PATCH] attach: append error msg when call attach failed
Signed-off-by: LiFeng <lifeng68@huawei.com>
---
src/lxc/tools/lxc_attach.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/lxc/tools/lxc_attach.c b/src/lxc/tools/lxc_attach.c
index 190f3c8..dbddc2a 100644
--- a/src/lxc/tools/lxc_attach.c
+++ b/src/lxc/tools/lxc_attach.c
@@ -401,12 +401,17 @@ static int do_attach_foreground(struct lxc_container *c, lxc_attach_command_t *c
ret = c->attach(c, lxc_attach_run_command, command, attach_options, &pid);
else
ret = c->attach(c, lxc_attach_run_shell, NULL, attach_options, &pid);
- if (ret < 0)
+ if (ret < 0) {
+ *errmsg = safe_strdup("Internal error, failed to call attach");
goto out;
+ }
ret = lxc_wait_for_pid_status(pid);
- if (ret < 0)
+ if (ret < 0) {
+ free(*errmsg);
+ *errmsg = safe_strdup("Internal error, failed to wait attached process");
goto out;
+ }
if (WIFEXITED(ret))
wexit = WEXITSTATUS(ret);
@@ -421,8 +426,10 @@ static int do_attach_foreground(struct lxc_container *c, lxc_attach_command_t *c
ERROR("Execd pid %d exit with %d", pid, wexit);
out:
- if (c->lxc_conf->errmsg)
+ if (c->lxc_conf->errmsg) {
+ free(*errmsg);
*errmsg = safe_strdup(c->lxc_conf->errmsg);
+ }
return wexit;
}
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。