fdstream: report error if virSetNonBlock fails

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.
This commit is contained in:
Roman Bogorodskiy 2014-08-15 08:55:15 +04:00
parent 4b772e469d
commit eb626b49fd

View File

@ -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;