* net.cc [errmap]: Add '0' condition.
(find_winsock_errno): Don't translate no error to EPERM.
This commit is contained in:
parent
4ba81bbab2
commit
f940c5b1aa
@ -1,3 +1,8 @@
|
|||||||
|
Mon Apr 23 12:46:07 2001 Christopher Faylor <cgf@cygnus.com>
|
||||||
|
|
||||||
|
* 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 <cgf@cygnus.com>
|
Sun Apr 22 20:48:24 2001 Christopher Faylor <cgf@cygnus.com>
|
||||||
|
|
||||||
* include/cygwin/version.h: Bump Cygwin version and API version.
|
* include/cygwin/version.h: Bump Cygwin version and API version.
|
||||||
|
@ -245,13 +245,14 @@ static struct tl errmap[] =
|
|||||||
{WSAEREMOTE, "WSAEREMOTE", EREMOTE},
|
{WSAEREMOTE, "WSAEREMOTE", EREMOTE},
|
||||||
{WSAEINVAL, "WSAEINVAL", EINVAL},
|
{WSAEINVAL, "WSAEINVAL", EINVAL},
|
||||||
{WSAEFAULT, "WSAEFAULT", EFAULT},
|
{WSAEFAULT, "WSAEFAULT", EFAULT},
|
||||||
|
{0, "NOERROR", 0},
|
||||||
{0, NULL, 0}
|
{0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
find_winsock_errno (int why)
|
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)
|
if (why == errmap[i].w)
|
||||||
return errmap[i].e;
|
return errmap[i].e;
|
||||||
|
|
||||||
|
@ -1630,7 +1630,7 @@ setmode (int fd, int mode)
|
|||||||
set_errno (EBADF);
|
set_errno (EBADF);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (mode != O_BINARY && mode != O_TEXT)
|
if (mode != O_BINARY && mode != O_TEXT && mode != 0)
|
||||||
{
|
{
|
||||||
set_errno (EINVAL);
|
set_errno (EINVAL);
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user