socket_strerror() sometimes maps errno, instead of its argument

Looks like a historical bug. Its err argument is an error number, but
if it isn't using a custom error message for it, it just calls
strerror() with the errno global, effectively ignoring its argument
and returning a semi-random string.
This commit is contained in:
Sam Roberts 2012-02-21 13:11:39 -08:00
parent db47a91d40
commit 27a3964ff7

View File

@ -418,8 +418,8 @@ const char *socket_strerror(int err) {
case ECONNREFUSED: return "connection refused";
case ECONNABORTED: return "closed";
case ECONNRESET: return "closed";
case ETIMEDOUT: return "timedout";
default: return strerror(errno);
case ETIMEDOUT: return "timeout";
default: return strerror(err);
}
}