openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/nss-pam-ldapd/0.9.8-r0/nss-pam-ldapd-0.9.8/nslcd/daemonize.c
static int read_response(int fd, char* buffer, size_t bufsz)
{
    int rc;
    size_t r = 0;
    while (r < bufsz)
    {
        rc = read(fd, buffer + r, bufsz - r);
        if (rc == 0)
            break;
        else if (rc > 0)
            r += rc;
        else if ((errno == EINTR) || (errno == EAGAIN))
            continue; /* ignore these errors and try again */
        else
        {
            log_log(LOG_ERR, "read_response(): read() failed: %s",
                    strerror(errno));
            return -1;
        }
    }
    return r;
}
/* try to fill the buffer until EOF or error */
try to fill the buffer until EOF or error
try to fill the buffer until EOF or error
static int read_response(int fd, char* buffer, size_t bufsz)
{
    int rc;
    size_t r = 0;
    while (r < bufsz)
    {
        rc = read(fd, buffer + r, bufsz - r);
        if (rc == 0)
            break;
        else if (rc > 0)
            r += rc;
        else if ((errno == EINTR) || (errno == EAGAIN))
            continue; 
        else
        {
            log_log(LOG_ERR, "read_response(): read() failed: %s",
                    strerror(errno));
            return -1;
        }
    }
    return r;
}
static int read_response ( int fd , char * buffer , size_t bufsz ) { int rc ; size_t r = 0 ; while ( r < bufsz ) { rc = read ( fd , buffer + r , bufsz - r ) ; if ( rc == 0 ) break ; else if ( rc > 0 ) r += rc ; else if ( ( errno == EINTR ) || ( errno == EAGAIN ) ) continue ; else { log_log ( LOG_ERR , " " , strerror ( errno ) ) ; return -1 ; } } return r ; }
try to fill the buffer until EOF or error
try to fill the buffer until EOF or error
/* ignore these errors and try again */