* net.cc [errmap]: Add '0' condition.

(find_winsock_errno): Don't translate no error to EPERM.
This commit is contained in:
Christopher Faylor
2001-04-23 16:46:30 +00:00
parent 4ba81bbab2
commit f940c5b1aa
3 changed files with 8 additions and 2 deletions

View File

@ -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;