提交 3172d267 编写于 作者: M Michal Privoznik

virProcessRunInMountNamespace: Report errors from child

The comment to the function states that the errors from the child
process are reported. Well, the error buffer is filled with
possible error messages. But then it is thrown away. Among with
important error message from the child process.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 aaf0ac7e
......@@ -1137,8 +1137,14 @@ virProcessRunInMountNamespace(pid_t pid,
VIR_FORCE_CLOSE(errfd[1]);
ignore_value(virFileReadHeaderFD(errfd[0], 1024, &buf));
ret = virProcessWait(child, &status, false);
if (!ret)
if (!ret) {
ret = status == EXIT_CANCELED ? -1 : status;
if (ret) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("child reported: %s"),
NULLSTR(buf));
}
}
VIR_FREE(buf);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册