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

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

 



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

Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]