virFDStreamOpenInternal terminates if virSetNonBlock fails. As
virSetNonBlock uses gnulib's set_nonblocking_flag that sets errno,
call virReportSystemError() to let user know the reason of fail.
---
 src/fdstream.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/fdstream.c b/src/fdstream.c
index fd576ef..d236318 100644
--- a/src/fdstream.c
+++ b/src/fdstream.c
@@ -478,8 +478,10 @@ static int virFDStreamOpenInternal(virStreamPtr st,
               st, fd, cmd, errfd, length);
 
     if ((st->flags & VIR_STREAM_NONBLOCK) &&
-        virSetNonBlock(fd) < 0)
+        virSetNonBlock(fd) < 0) {
+        virReportSystemError(errno, "%s", _("Unable to set non-blocking 
mode"));
         return -1;
+    }
 
     if (VIR_ALLOC(fdst) < 0)
         return -1;
-- 
1.9.0

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

Reply via email to