From e69aaf2f7ea06a22a7c2f31d0a774d316d8e9984 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Tue, 27 Nov 2012 12:35:49 +0000 Subject: [PATCH] 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: Daniel P. Berrange (cherry picked from commit 0584d6626b07a55ede81d7ffde9565e9a305c172) --- src/util/virnetdevveth.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/util/virnetdevveth.c b/src/util/virnetdevveth.c index 7414a14506..4166ee09d7 100644 --- a/src/util/virnetdevveth.c +++ b/src/util/virnetdevveth.c @@ -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); }