[libosinfo 2/4] loader: Set GError on osinfo_loader_nodeset failures

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

 



Most of the code in OsinfoLoader check if osinfo_loader_nodeset
set a GError to see if it failed and never test if it returned -1.
Better to make sure that we actually set the GError when this
function fails.
---
 osinfo/osinfo_loader.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
index 1c27187..606e413 100644
--- a/osinfo/osinfo_loader.c
+++ b/osinfo/osinfo_loader.c
@@ -133,6 +133,8 @@ osinfo_loader_nodeset(const char *xpath,
     if (obj == NULL)
         return(0);
     if (obj->type != XPATH_NODESET) {
+        g_set_error(err, g_quark_from_static_string("libosinfo"), 0,
+                    _("Expected a nodeset in XPath query %s"), xpath);
         xmlXPathFreeObject(obj);
         return (-1);
     }
-- 
1.8.0.1

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list


[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux