LeapGL/tests/event_injector/sockets.c
/* this function reads the latest winsock error code and updates
 * errno to a matching value. It also returns the new value of
 * errno.
 */
this function reads the latest winsock error code and updates
errno to a matching value. It also returns the new value of
errno.
this function reads the latest winsock error code and updates errno to a matching value . It also returns the new value of errno .
static int
_fix_errno( void )
{
    const WinsockError*  werr = _winsock_errors;
    int                  unix = EINVAL;  
    winsock_error = WSAGetLastError();
    for ( ; werr->string != NULL; werr++ ) {
        if (werr->winsock == winsock_error) {
            unix = werr->unix;
            break;
        }
    }
    errno = unix;
    return -1;
}
static int _fix_errno ( void ) { const WinsockError * werr = _winsock_errors ; int unix = EINVAL ; winsock_error = WSAGetLastError ( ) ; for ( ; werr -> string != NULL ; werr ++ ) { if ( werr -> winsock == winsock_error ) { unix = werr -> unix ; break ; } } errno = unix ; return -1 ; }
this function reads the latest winsock error code and updates
 errno to a matching value.
this function reads the latest winsock error code and updates errno to a matching value .
/* generic error code */