提交 e69aaf2f 编写于 作者: D Daniel P. Berrange 提交者: Cole Robinson

Fix error reporting in virNetDevVethDelete

In virNetDevVethDelete the virRun method will properly report
errors, but when checking the exit status for non-zero exit
code no error is reported
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
(cherry picked from commit 0584d662)
上级 dd35c8da
......@@ -162,24 +162,9 @@ cleanup:
*/
int virNetDevVethDelete(const char *veth)
{
int rc;
const char *argv[] = {"ip", "link", "del", veth, NULL};
int cmdResult = 0;
VIR_DEBUG("veth: %s", veth);
rc = virRun(argv, &cmdResult);
if (rc != 0 ||
(WIFEXITED(cmdResult) && WEXITSTATUS(cmdResult) != 0)) {
/*
* Prevent overwriting an error log which may be set
* where an actual failure occurs.
*/
VIR_DEBUG("Failed to delete '%s' (%d)",
veth, WEXITSTATUS(cmdResult));
rc = -1;
}
return rc;
return virRun(argv, NULL);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册