if (0 != pd->out_flags) ready++;
static PRInt32 CheckPollDescEndpoints(PRPollDesc *pds, PRIntn npds, const PRInt16 *inReadFlags, const PRInt16 *inWriteFlags){    PRInt32 ready = 0;    PRPollDesc *pd, *epd;    const PRInt16   *readFlag, *writeFlag;        for (pd = pds, epd = pd + npds, readFlag = inReadFlags, writeFlag = inWriteFlags;         pd < epd;        pd++, readFlag++, writeFlag++)    {        PRFileDesc *bottomFD;        PRBool      readReady, writeReady, exceptReady;        PRInt16     in_flags_read = *readFlag;        PRInt16     in_flags_write = *writeFlag;        if (NULL == pd->fd || pd->in_flags == 0) continue;        bottomFD = PR_GetIdentitiesLayer(pd->fd, PR_NSPR_IO_LAYER);        /* bottomFD can be NULL for pollable sockets */        if (bottomFD)        {            if (_PR_FILEDESC_OPEN == bottomFD->secret->state)            {                pd->out_flags = 0;  /* pre-condition */                if (GetState(bottomFD, &readReady, &writeReady, &exceptReady))                {                    if (readReady)                    {                        if (in_flags_read & PR_POLL_READ)                            pd->out_flags |= PR_POLL_READ;                        if (in_flags_write & PR_POLL_READ)                            pd->out_flags |= PR_POLL_WRITE;                    }                    if (writeReady)                    {                        if (in_flags_read & PR_POLL_WRITE)                            pd->out_flags |= PR_POLL_READ;                        if (in_flags_write & PR_POLL_WRITE)                            pd->out_flags |= PR_POLL_WRITE;                    }                    if (exceptReady && (pd->in_flags & PR_POLL_EXCEPT))                    {                        pd->out_flags |= PR_POLL_EXCEPT;                    }                    if (0 != pd->out_flags) ready++;                }            }            else    /* bad state */            {                ready += 1;  /* this will cause an abrupt return */                pd->out_flags = PR_POLL_NVAL;  /* bogii */            }        }    }    return ready;}