} else { _PR_MD_MAP_RECV_ERROR(err);
if ((rv = socket_io_wait(osfd, READ_FD, timeout)) < 0) goto done; } else if ((err == SOCEINTR) && (!_PR_PENDING_INTERRUPT(me))){ continue; } else {
_PR_MD_RECV(PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags,             PRIntervalTime timeout){    PRInt32 osfd = fd->secret->md.osfd;    PRInt32 rv, err;#ifdef BSD_SELECT    struct timeval tv, *tvp;    fd_set rd;#else    int socks[1];     long lTimeout = -1; #endif    int osflags;    if (0 == flags) {        osflags = 0;    } else {        PR_ASSERT(PR_MSG_PEEK == flags);        osflags = MSG_PEEK;    }    while ((rv = recv( osfd, buf, amount, osflags)) == -1)     {        if (((err = sock_errno()) == EWOULDBLOCK)             && (!fd->secret->nonblocking))        {#ifdef BSD_SELECT           FD_ZERO(&rd);           FD_SET(osfd, &rd);           if (timeout == PR_INTERVAL_NO_TIMEOUT)            {               tvp = NULL;           }            else            {               tv.tv_sec = PR_IntervalToSeconds(timeout);               tv.tv_usec = PR_IntervalToMicroseconds(               timeout - PR_SecondsToInterval(tv.tv_sec));               tvp = &tv;           }           if ((rv = _MD_SELECT(osfd + 1, &rd, NULL, NULL, tvp)) == -1) #else            socks[0] = osfd;             if (timeout == PR_INTERVAL_NO_TIMEOUT)             {                lTimeout = -1;             }             else             {                lTimeout = PR_IntervalToMilliseconds(timeout);             }            if ((rv = _MD_SELECT(socks, 1, 0, 0, lTimeout)) == -1) #endif            {                _PR_MD_MAP_SELECT_ERROR(sock_errno());                return -1;            }             else if (rv == 0)             {                PR_SetError(PR_IO_TIMEOUT_ERROR, 0);                rv = -1;                break;            }        }         else         {            _PR_MD_MAP_RECV_ERROR(err);            break;        }    } /* end while() */    return(rv);}