[PATCH] Fix error report from nl_recvmsg

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

The nl_recvmsg does not always set errno. Instead it returns
its own custom set of error codes. Thus we were reporting the
wrong data.
---
 src/util/virnetlink.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c
index 0b36fdc..8b47ede 100644
--- a/src/util/virnetlink.c
+++ b/src/util/virnetlink.c
@@ -335,8 +335,9 @@ virNetlinkEventCallback(int watch,
     if (length == 0)
         return;
     if (length < 0) {
-        virReportSystemError(errno,
-                             "%s", _("nl_recv returned with error"));
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                       _("nl_recv returned with error: %s"),
+                       nl_geterror(length));
         return;
     }
 
-- 
1.7.11.7

--
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]