提交 0584d662 编写于 作者: D Daniel P. Berrange

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>
上级 9d2bfc1c
...@@ -162,24 +162,9 @@ cleanup: ...@@ -162,24 +162,9 @@ cleanup:
*/ */
int virNetDevVethDelete(const char *veth) int virNetDevVethDelete(const char *veth)
{ {
int rc;
const char *argv[] = {"ip", "link", "del", veth, NULL}; const char *argv[] = {"ip", "link", "del", veth, NULL};
int cmdResult = 0;
VIR_DEBUG("veth: %s", veth); VIR_DEBUG("veth: %s", veth);
rc = virRun(argv, &cmdResult); return virRun(argv, NULL);
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;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册