1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-04 04:43:14 +02:00

Made the win32 socket error reporting also handle regular system errors

This commit is contained in:
codemastr
2004-06-01 21:28:54 +00:00
parent 55001ad74a
commit 30f7b2c519
2 changed files with 8 additions and 1 deletions
+2
View File
@@ -3228,3 +3228,5 @@ This is the 3.2 fixes branch.
LinDevel
- Added /dns c to clear the DNS cache (#0001852) suggested by samson.
- Seems I forgot to del_Command() SPAMFILTER and TEMPSHUN.
- Made the win32 socket error reporting also handle regular system errors (#0001851)
reported by Troco
+6 -1
View File
@@ -2330,6 +2330,7 @@ struct u_WSA_errors WSAErrors[] = {
char *sock_strerror(int error)
{
static char unkerr[64];
int start = 0;
int stop = sizeof(WSAErrors)/sizeof(WSAErrors[0])-1;
int mid;
@@ -2337,6 +2338,9 @@ char *sock_strerror(int error)
if (!error) /* strerror compatibility */
return NULL;
if (error < WSABASEERR) /* Just a regular error code */
return strerror(error);
/* Microsoft decided not to use sequential numbers for the error codes,
* so we can't just use the array index for the code. But, at least
* use a binary search to make it as fast as possible.
@@ -2352,6 +2356,7 @@ char *sock_strerror(int error)
else
return WSAErrors[mid].error_string;
}
return NULL;
sprintf(unkerr, "Unknown Error: %d", error);
return unkerr;
}
#endif