[Libguestfs] [PATCH v2 4/6] lib: Return EPIPE for "appliance closed the connection unexpectedly".

Richard W.M. Jones rjones at redhat.com
Fri Mar 3 21:59:27 UTC 2017


---
 lib/errors.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/lib/errors.c b/lib/errors.c
index c2af611..ace6a89 100644
--- a/lib/errors.c
+++ b/lib/errors.c
@@ -358,12 +358,15 @@ void
 guestfs_int_unexpected_close_error (guestfs_h *g)
 {
   if (g->verbose)
-    error (g, _("appliance closed the connection unexpectedly, see earlier error messages"));
+    guestfs_int_error_errno (g, EPIPE,
+                             _("appliance closed the connection unexpectedly, "
+                               "see earlier error messages"));
   else
-    error (g, _(
-		"appliance closed the connection unexpectedly.\n"
-		"This usually means the libguestfs appliance crashed.\n"
-		DEBUG_ADVICE));
+    guestfs_int_error_errno (g, EPIPE,
+                             _("appliance closed the connection unexpectedly.\n"
+                               "This usually means the libguestfs appliance "
+                               "crashed.\n"
+                               DEBUG_ADVICE));
 }
 
 /**
-- 
2.9.3




More information about the Libguestfs mailing list