summaryrefslogtreecommitdiff
path: root/lib/inet_pton.c
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2017-06-19 00:52:38 -0400
committerJay Satiro <raysatiro@yahoo.com>2017-07-10 02:09:27 -0400
commitaf0216251b94e751baa47146ac9609db70793b8e (patch)
treede39c7130d519f0bcda17b9a09df822f02fc32e6 /lib/inet_pton.c
parent17da6750026cf00277aad3a44fd20b1a4cea6406 (diff)
downloadcurl-af0216251b94e751baa47146ac9609db70793b8e.tar.gz
curl_setup_once: Remove ERRNO/SET_ERRNO macros
Prior to this change (SET_)ERRNO mapped to GetLastError/SetLastError for Win32 and regular errno otherwise. I reviewed the code and found no justifiable reason for conflating errno on WIN32 with GetLastError/SetLastError. All Win32 CRTs support errno, and any Win32 multithreaded CRT supports thread-local errno. Fixes https://github.com/curl/curl/issues/895 Closes https://github.com/curl/curl/pull/1589
Diffstat (limited to 'lib/inet_pton.c')
-rw-r--r--lib/inet_pton.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/inet_pton.c b/lib/inet_pton.c
index 475f44abc..fef9610d1 100644
--- a/lib/inet_pton.c
+++ b/lib/inet_pton.c
@@ -57,8 +57,8 @@ static int inet_pton6(const char *src, unsigned char *dst);
* notice:
* On Windows we store the error in the thread errno, not
* in the winsock error code. This is to avoid losing the
- * actual last winsock error. So use macro ERRNO to fetch the
- * errno this function sets when returning (-1), not SOCKERRNO.
+ * actual last winsock error. So when this function returns
+ * -1, check errno not SOCKERRNO.
* author:
* Paul Vixie, 1996.
*/
@@ -73,7 +73,7 @@ Curl_inet_pton(int af, const char *src, void *dst)
return (inet_pton6(src, (unsigned char *)dst));
#endif
default:
- SET_ERRNO(EAFNOSUPPORT);
+ errno = EAFNOSUPPORT;
return (-1);
}
/* NOTREACHED */