[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 13/21] admin: Be consistent when resetting errors



Resetting an error should be the first thing public API does.

Signed-off-by: Martin Kletzander <mkletzan redhat com>
---
 src/libvirt-admin.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/libvirt-admin.c b/src/libvirt-admin.c
index 44b4d4090e59..add4fcc3576a 100644
--- a/src/libvirt-admin.c
+++ b/src/libvirt-admin.c
@@ -371,11 +371,12 @@ virAdmConnectIsAlive(virAdmConnectPtr conn)

     VIR_DEBUG("conn=%p", conn);

+    virResetLastError();
+
     if (!conn)
         return 0;

     virCheckAdmConnectReturn(conn, -1);
-    virResetLastError();

     priv = conn->privateData;
     virObjectLock(priv);
-- 
2.7.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]