aboutsummaryrefslogtreecommitdiff
path: root/lib/inet_pton.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/inet_pton.c')
-rw-r--r--lib/inet_pton.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/inet_pton.c b/lib/inet_pton.c
index 9b9f88b5e..edffeabca 100644
--- a/lib/inet_pton.c
+++ b/lib/inet_pton.c
@@ -66,6 +66,11 @@ static int inet_pton6(const char *src, unsigned char *dst);
* 1 if the address was valid for the specified address family
* 0 if the address wasn't valid (`dst' is untouched in this case)
* -1 if some other error occurred (`dst' is untouched in this case, too)
+ * notice:
+ * On Windows we store the error in the thread errno, not
+ * in the winsock error code. This is to avoid loosing the
+ * actual last winsock error. So use macro ERRNO to fetch the
+ * errno this funtion sets when returning (-1), not SOCKERRNO.
* author:
* Paul Vixie, 1996.
*/
@@ -83,7 +88,7 @@ Curl_inet_pton(int af, const char *src, void *dst)
return (inet_pton6(src, (unsigned char *)dst));
#endif
default:
- errno = EAFNOSUPPORT;
+ SET_ERRNO(EAFNOSUPPORT);
return (-1);
}
/* NOTREACHED */