server/sock.c
/* set the last error depending on errno */
set the last error depending on errno
set the last error depending on errno
static int sock_get_error( int err )
{
    switch (err)
    {
        case EINTR:             return WSAEINTR;
        case EBADF:             return WSAEBADF;
        case EPERM:
        case EACCES:            return WSAEACCES;
        case EFAULT:            return WSAEFAULT;
        case EINVAL:            return WSAEINVAL;
        case EMFILE:            return WSAEMFILE;
        case EWOULDBLOCK:       return WSAEWOULDBLOCK;
        case EINPROGRESS:       return WSAEINPROGRESS;
        case EALREADY:          return WSAEALREADY;
        case ENOTSOCK:          return WSAENOTSOCK;
        case EDESTADDRREQ:      return WSAEDESTADDRREQ;
        case EMSGSIZE:          return WSAEMSGSIZE;
        case EPROTOTYPE:        return WSAEPROTOTYPE;
        case ENOPROTOOPT:       return WSAENOPROTOOPT;
        case EPROTONOSUPPORT:   return WSAEPROTONOSUPPORT;
        case ESOCKTNOSUPPORT:   return WSAESOCKTNOSUPPORT;
        case EOPNOTSUPP:        return WSAEOPNOTSUPP;
        case EPFNOSUPPORT:      return WSAEPFNOSUPPORT;
        case EAFNOSUPPORT:      return WSAEAFNOSUPPORT;
        case EADDRINUSE:        return WSAEADDRINUSE;
        case EADDRNOTAVAIL:     return WSAEADDRNOTAVAIL;
        case ENETDOWN:          return WSAENETDOWN;
        case ENETUNREACH:       return WSAENETUNREACH;
        case ENETRESET:         return WSAENETRESET;
        case ECONNABORTED:      return WSAECONNABORTED;
        case EPIPE:
        case ECONNRESET:        return WSAECONNRESET;
        case ENOBUFS:           return WSAENOBUFS;
        case EISCONN:           return WSAEISCONN;
        case ENOTCONN:          return WSAENOTCONN;
        case ESHUTDOWN:         return WSAESHUTDOWN;
        case ETOOMANYREFS:      return WSAETOOMANYREFS;
        case ETIMEDOUT:         return WSAETIMEDOUT;
        case ECONNREFUSED:      return WSAECONNREFUSED;
        case ELOOP:             return WSAELOOP;
        case ENAMETOOLONG:      return WSAENAMETOOLONG;
        case EHOSTDOWN:         return WSAEHOSTDOWN;
        case EHOSTUNREACH:      return WSAEHOSTUNREACH;
        case ENOTEMPTY:         return WSAENOTEMPTY;
#ifdef EPROCLIM
        case EPROCLIM:          return WSAEPROCLIM;
#endif
#ifdef EUSERS
        case EUSERS:            return WSAEUSERS;
#endif
#ifdef EDQUOT
        case EDQUOT:            return WSAEDQUOT;
#endif
#ifdef ESTALE
        case ESTALE:            return WSAESTALE;
#endif
#ifdef EREMOTE
        case EREMOTE:           return WSAEREMOTE;
#endif
        case 0:                 return 0;
        default:
            errno = err;
            perror("wineserver: sock_get_error() can't map error");
            return WSAEFAULT;
    }
}
static int sock_get_error ( int err ) { switch ( err ) { case EINTR : return WSAEINTR ; case EBADF : return WSAEBADF ; case EPERM : case EACCES : return WSAEACCES ; case EFAULT : return WSAEFAULT ; case EINVAL : return WSAEINVAL ; case EMFILE : return WSAEMFILE ; case EWOULDBLOCK : return WSAEWOULDBLOCK ; case EINPROGRESS : return WSAEINPROGRESS ; case EALREADY : return WSAEALREADY ; case ENOTSOCK : return WSAENOTSOCK ; case EDESTADDRREQ : return WSAEDESTADDRREQ ; case EMSGSIZE : return WSAEMSGSIZE ; case EPROTOTYPE : return WSAEPROTOTYPE ; case ENOPROTOOPT : return WSAENOPROTOOPT ; case EPROTONOSUPPORT : return WSAEPROTONOSUPPORT ; case ESOCKTNOSUPPORT : return WSAESOCKTNOSUPPORT ; case EOPNOTSUPP : return WSAEOPNOTSUPP ; case EPFNOSUPPORT : return WSAEPFNOSUPPORT ; case EAFNOSUPPORT : return WSAEAFNOSUPPORT ; case EADDRINUSE : return WSAEADDRINUSE ; case EADDRNOTAVAIL : return WSAEADDRNOTAVAIL ; case ENETDOWN : return WSAENETDOWN ; case ENETUNREACH : return WSAENETUNREACH ; case ENETRESET : return WSAENETRESET ; case ECONNABORTED : return WSAECONNABORTED ; case EPIPE : case ECONNRESET : return WSAECONNRESET ; case ENOBUFS : return WSAENOBUFS ; case EISCONN : return WSAEISCONN ; case ENOTCONN : return WSAENOTCONN ; case ESHUTDOWN : return WSAESHUTDOWN ; case ETOOMANYREFS : return WSAETOOMANYREFS ; case ETIMEDOUT : return WSAETIMEDOUT ; case ECONNREFUSED : return WSAECONNREFUSED ; case ELOOP : return WSAELOOP ; case ENAMETOOLONG : return WSAENAMETOOLONG ; case EHOSTDOWN : return WSAEHOSTDOWN ; case EHOSTUNREACH : return WSAEHOSTUNREACH ; case ENOTEMPTY : return WSAENOTEMPTY ; #ifdef EPROCLIM case EPROCLIM : return WSAEPROCLIM ; #endif #ifdef EUSERS case EUSERS : return WSAEUSERS ; #endif #ifdef EDQUOT case EDQUOT : return WSAEDQUOT ; #endif #ifdef ESTALE case ESTALE : return WSAESTALE ; #endif #ifdef EREMOTE case EREMOTE : return WSAEREMOTE ; #endif case 0 : return 0 ; default : errno = err ; perror ( " " ) ; return WSAEFAULT ; } }
set the last error depending on errno
set the last error depending on errno