[PATCH 2/9] fdstream: Report error with virProcessTranslateStatus

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

 



Rather than poorly duplicate it
---
 src/fdstream.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/fdstream.c b/src/fdstream.c
index 681b90e..b0a46e9 100644
--- a/src/fdstream.c
+++ b/src/fdstream.c
@@ -43,6 +43,7 @@
 #include "configmake.h"
 #include "virstring.h"
 #include "virtime.h"
+#include "virprocess.h"
 
 #define VIR_FROM_THIS VIR_FROM_STREAMS
 
@@ -263,13 +264,12 @@ virFDStreamCloseCommand(struct virFDStreamData *fdst)
     if (status != 0) {
         if (buf[0] != '\0') {
             virReportError(VIR_ERR_INTERNAL_ERROR, "%s", buf);
-        } else if (WIFEXITED(status)) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("I/O helper exited with status %d"),
-                           WEXITSTATUS(status));
         } else {
-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                           _("I/O helper exited abnormally"));
+            char *str = virProcessTranslateStatus(status);
+            virReportError(VIR_ERR_INTERNAL_ERROR,
+                           _("I/O helper exited with %s"),
+                           NULLSTR(str));
+            VIR_FREE(str);
         }
         goto error;
     }
-- 
2.7.3

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