LeapGL/tests/event_injector/emulator-console.c
/* Read as much from the input as possible, ignoring it.
 */
Read as much from the input as possible, ignoring it.
Read as much from the input as possible ignoring it .
static int
emulatorConsole_eatInput( EmulatorConsole* con )
{
    for (;;) {
        char temp[64];
        int ret = socket_recv(con->fd, temp, sizeof temp);
        if (ret < 0) {
            if (errno == EAGAIN || errno == EWOULDBLOCK) {
                return 0;
            }
            return -1;
        }
        if (ret == 0) {
            return -1;
        }
        DD("Console received: '%.*s'", ret, temp);
    }
}
static int emulatorConsole_eatInput ( EmulatorConsole * con ) { for ( ; ; ) { char temp [ 64 ] ; int ret = socket_recv ( con -> fd , temp , sizeof temp ) ; if ( ret < 0 ) { if ( errno == EAGAIN || errno == EWOULDBLOCK ) { return 0 ; } return -1 ; } if ( ret == 0 ) { return -1 ; } DD ( " " , ret , temp ) ; } }
Read as much from the input as possible, ignoring it.
Read as much from the input as possible ignoring it .