static void tcp_wait_for_connect(void *opaque)

{

    MigrationState *s = opaque;

    int val, ret;

    socklen_t valsize = sizeof(val);



    DPRINTF("connect completed\n");

    do {

        ret = getsockopt(s->fd, SOL_SOCKET, SO_ERROR, (void *) &val, &valsize);

    } while (ret == -1 && (socket_error()) == EINTR);



    if (ret < 0) {

        migrate_fd_error(s);

        return;

    }



    qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);



    if (val == 0)

        migrate_fd_connect(s);

    else {

        DPRINTF("error connecting %d\n", val);

        migrate_fd_error(s);

    }

}

static void tcp_wait_for_connect(void *opaque)

{

    MigrationState *s = opaque;

    int val, ret;

    socklen_t valsize = sizeof(val);



    DPRINTF("connect completed\n");

    do {

        ret = getsockopt(s->fd, SOL_SOCKET, SO_ERROR, (void *) &val, &valsize);

    } while (ret == -1 && (socket_error()) == EINTR);



    if (ret < 0) {

        migrate_fd_error(s);

        return;

    }



    qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);



    if (val == 0)

        migrate_fd_connect(s);

    else {

        DPRINTF("error connecting %d\n", val);

        migrate_fd_error(s);

    }

}

static void tcp_wait_for_connect(void *opaque)     int val, ret;     socklen_t valsize = sizeof(val);     DPRINTF("connect completed\n");     do {         ret = getsockopt(s->fd, SOL_SOCKET, SO_ERROR, (void *) &val, &valsize);     } while (ret == -1 && (socket_error()) == EINTR);     if (ret < 0) {     qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);     if (val == 0)     else {         DPRINTF("error connecting %d\n", val);         migrate_fd_error(s);         migrate_fd_connect(s);
static void FUNC_0(void *VAR_0)

{

    MigrationState *s = VAR_0;

    int VAR_1, VAR_2;

    socklen_t valsize = sizeof(VAR_1);



    DPRINTF("connect completed\n");

    do {

        VAR_2 = getsockopt(s->fd, SOL_SOCKET, SO_ERROR, (void *) &VAR_1, &valsize);

    } while (VAR_2 == -1 && (socket_error()) == EINTR);



    if (VAR_2 < 0) {

        migrate_fd_error(s);

        return;

    }



    qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);



    if (VAR_1 == 0)

        migrate_fd_connect(s);

    else {

        DPRINTF("error connecting %d\n", VAR_1);

        migrate_fd_error(s);

    }

}

static void FUNC_0(void *VAR_0)
{ MigrationState *s = VAR_0; int VAR_1, VAR_2; socklen_t valsize = sizeof(VAR_1); DPRINTF("connect completed\n"); do { VAR_2 = getsockopt(s->fd, SOL_SOCKET, SO_ERROR, (void *) &VAR_1, &valsize); } while (VAR_2 == -1 && (socket_error()) == EINTR); if (VAR_2 < 0) { migrate_fd_error(s); return; } qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL); if (VAR_1 == 0)
migrate_fd_connect(s); else { DPRINTF("error connecting %d\n", VAR_1); migrate_fd_error(s); } }