Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik M. Bray <erik.m.bray@gmail.com>2019-04-23 17:55:33 +0300
committerCorinna Vinschen <corinna@vinschen.de>2019-04-23 18:20:57 +0300
commit489e7e20480ff34a519d7299b226c56fa99f14a8 (patch)
tree1b2d03e8492f071b0c39516ff74bd328ec147724 /winsup/cygwin/net.cc
parent9957a7895be652b502f53811e581d923f93c135f (diff)
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.
Diffstat (limited to 'winsup/cygwin/net.cc')
-rw-r--r--winsup/cygwin/net.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index cd296d19d..437712c63 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -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