int qio_channel_socket_connect_sync(QIOChannelSocket *ioc,

                                    SocketAddress *addr,

                                    Error **errp)

{

    int fd;



    trace_qio_channel_socket_connect_sync(ioc, addr);

    fd = socket_connect(addr, NULL, NULL, errp);

    if (fd < 0) {

        trace_qio_channel_socket_connect_fail(ioc);

        return -1;

    }



    trace_qio_channel_socket_connect_complete(ioc, fd);

    if (qio_channel_socket_set_fd(ioc, fd, errp) < 0) {

        close(fd);

        return -1;

    }



    return 0;

}

int qio_channel_socket_connect_sync(QIOChannelSocket *ioc,

                                    SocketAddress *addr,

                                    Error **errp)

{

    int fd;



    trace_qio_channel_socket_connect_sync(ioc, addr);

    fd = socket_connect(addr, NULL, NULL, errp);

    if (fd < 0) {

        trace_qio_channel_socket_connect_fail(ioc);

        return -1;

    }



    trace_qio_channel_socket_connect_complete(ioc, fd);

    if (qio_channel_socket_set_fd(ioc, fd, errp) < 0) {

        close(fd);

        return -1;

    }



    return 0;

}

int FUNC_0(QIOChannelSocket *VAR_0,

                                    SocketAddress *VAR_1,

                                    Error **VAR_2)

{

    int VAR_3;



    trace_qio_channel_socket_connect_sync(VAR_0, VAR_1);

    VAR_3 = socket_connect(VAR_1, NULL, NULL, VAR_2);

    if (VAR_3 < 0) {

        trace_qio_channel_socket_connect_fail(VAR_0);

        return -1;

    }



    trace_qio_channel_socket_connect_complete(VAR_0, VAR_3);

    if (qio_channel_socket_set_fd(VAR_0, VAR_3, VAR_2) < 0) {

        close(VAR_3);

        return -1;

    }



    return 0;

}

int FUNC_0(QIOChannelSocket *VAR_0,
SocketAddress *VAR_1,
Error **VAR_2)
{ int VAR_3; trace_qio_channel_socket_connect_sync(VAR_0, VAR_1); VAR_3 = socket_connect(VAR_1, NULL, NULL, VAR_2); if (VAR_3 < 0) { trace_qio_channel_socket_connect_fail(VAR_0); return -1; } trace_qio_channel_socket_connect_complete(VAR_0, VAR_3); if (qio_channel_socket_set_fd(VAR_0, VAR_3, VAR_2) < 0) { close(VAR_3); return -1; } return 0; }