static int pollfds_fill(GArray *pollfds, fd_set *rfds, fd_set *wfds,

                        fd_set *xfds)

{

    int nfds = -1;

    int i;



    for (i = 0; i < pollfds->len; i++) {

        GPollFD *pfd = &g_array_index(pollfds, GPollFD, i);

        int fd = pfd->fd;

        int events = pfd->events;

        if (events & G_IO_IN) {

            FD_SET(fd, rfds);

            nfds = MAX(nfds, fd);

        }

        if (events & G_IO_OUT) {

            FD_SET(fd, wfds);

            nfds = MAX(nfds, fd);

        }

        if (events & G_IO_PRI) {

            FD_SET(fd, xfds);

            nfds = MAX(nfds, fd);

        }

    }

    return nfds;

}

static int pollfds_fill(GArray *pollfds, fd_set *rfds, fd_set *wfds,

                        fd_set *xfds)

{

    int nfds = -1;

    int i;



    for (i = 0; i < pollfds->len; i++) {

        GPollFD *pfd = &g_array_index(pollfds, GPollFD, i);

        int fd = pfd->fd;

        int events = pfd->events;

        if (events & G_IO_IN) {

            FD_SET(fd, rfds);

            nfds = MAX(nfds, fd);

        }

        if (events & G_IO_OUT) {

            FD_SET(fd, wfds);

            nfds = MAX(nfds, fd);

        }

        if (events & G_IO_PRI) {

            FD_SET(fd, xfds);

            nfds = MAX(nfds, fd);

        }

    }

    return nfds;

}

static int FUNC_0(GArray *VAR_0, fd_set *VAR_1, fd_set *VAR_2,

                        fd_set *VAR_3)

{

    int VAR_4 = -1;

    int VAR_5;



    for (VAR_5 = 0; VAR_5 < VAR_0->len; VAR_5++) {

        GPollFD *pfd = &g_array_index(VAR_0, GPollFD, VAR_5);

        int fd = pfd->fd;

        int events = pfd->events;

        if (events & G_IO_IN) {

            FD_SET(fd, VAR_1);

            VAR_4 = MAX(VAR_4, fd);

        }

        if (events & G_IO_OUT) {

            FD_SET(fd, VAR_2);

            VAR_4 = MAX(VAR_4, fd);

        }

        if (events & G_IO_PRI) {

            FD_SET(fd, VAR_3);

            VAR_4 = MAX(VAR_4, fd);

        }

    }

    return VAR_4;

}

static int FUNC_0(GArray *VAR_0, fd_set *VAR_1, fd_set *VAR_2,
fd_set *VAR_3)
{ int VAR_4 = -1; int VAR_5; for (VAR_5 = 0; VAR_5 < VAR_0->len; VAR_5++) { GPollFD *pfd = &g_array_index(VAR_0, GPollFD, VAR_5); int fd = pfd->fd; int events = pfd->events; if (events & G_IO_IN) { FD_SET(fd, VAR_1); VAR_4 = MAX(VAR_4, fd); } if (events & G_IO_OUT) { FD_SET(fd, VAR_2); VAR_4 = MAX(VAR_4, fd); } if (events & G_IO_PRI) { FD_SET(fd, VAR_3); VAR_4 = MAX(VAR_4, fd); } } return VAR_4; }