mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-03-02 13:05:42 +08:00
Minor improvements to socket error handling:
* Change default fallback for failed winsock error -> POSIX error mappings to EACCES, which is a valid errno for more socket-related syscalls. * Added a few previously missing entries to the wsock_errmap table that have obvious POSIX errno.h analogues. (cherry picked from commit 489e7e20480ff34a519d7299b226c56fa99f14a8)
This commit is contained in:
parent
ca4dd0b35c
commit
debad46cfe
@ -177,6 +177,9 @@ static const errmap_t wsock_errmap[] = {
|
||||
{WSAEREMOTE, "WSAEREMOTE", EREMOTE},
|
||||
{WSAEINVAL, "WSAEINVAL", EINVAL},
|
||||
{WSAEFAULT, "WSAEFAULT", EFAULT},
|
||||
{WSAEBADF, "WSAEBADF", EBADF},
|
||||
{WSAEACCES, "WSAEACCES", EACCES},
|
||||
{WSAEMFILE, "WSAEMFILE", EMFILE},
|
||||
{0, "NOERROR", 0},
|
||||
{0, NULL, 0}
|
||||
};
|
||||
@ -188,7 +191,7 @@ find_winsock_errno (DWORD why)
|
||||
if (why == wsock_errmap[i].w)
|
||||
return wsock_errmap[i].e;
|
||||
|
||||
return EPERM;
|
||||
return EACCES;
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
x
Reference in New Issue
Block a user