Commit 1a751ebf authored by Stefan Hajnoczi's avatar Stefan Hajnoczi Committed by Luiz Capitulino
Browse files

qemu-socket: set passed fd non-blocking in socket_connect()



socket_connect() sets non-blocking on TCP or UNIX domain sockets if a
callback function is passed.  Do the same for file descriptor passing,
otherwise we could unexpectedly be using a blocking file descriptor.

Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Signed-off-by: default avatarLuiz Capitulino <lcapitulino@redhat.com>
parent fc13fa00
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -910,6 +910,7 @@ int socket_connect(SocketAddress *addr, Error **errp,
    case SOCKET_ADDRESS_KIND_FD:
        fd = monitor_get_fd(cur_mon, addr->fd->str, errp);
        if (callback) {
            qemu_set_nonblock(fd);
            callback(fd, opaque);
        }
        break;