From f940c5b1aa1a06097df8fffcc4c409c1f0702d4c Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 23 Apr 2001 16:46:30 +0000 Subject: [PATCH] * net.cc [errmap]: Add '0' condition. (find_winsock_errno): Don't translate no error to EPERM. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/net.cc | 3 ++- winsup/cygwin/syscalls.cc | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 4c01080a2..d2224146a 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +Mon Apr 23 12:46:07 2001 Christopher Faylor + + * net.cc [errmap]: Add '0' condition. + (find_winsock_errno): Don't translate no error to EPERM. + Sun Apr 22 20:48:24 2001 Christopher Faylor * include/cygwin/version.h: Bump Cygwin version and API version. diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index 990df2451..30b090164 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -245,13 +245,14 @@ static struct tl errmap[] = {WSAEREMOTE, "WSAEREMOTE", EREMOTE}, {WSAEINVAL, "WSAEINVAL", EINVAL}, {WSAEFAULT, "WSAEFAULT", EFAULT}, + {0, "NOERROR", 0}, {0, NULL, 0} }; static int find_winsock_errno (int why) { - for (int i = 0; errmap[i].w != 0; ++i) + for (int i = 0; errmap[i].s != NULL; ++i) if (why == errmap[i].w) return errmap[i].e; diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 25dc93c16..4e862a21f 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -1630,7 +1630,7 @@ setmode (int fd, int mode) set_errno (EBADF); return -1; } - if (mode != O_BINARY && mode != O_TEXT) + if (mode != O_BINARY && mode != O_TEXT && mode != 0) { set_errno (EINVAL); return -1;