aboutsummaryrefslogtreecommitdiff
path: root/lib/inet_pton.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-02-16 18:19:35 +0000
committerYang Tse <yangsita@gmail.com>2007-02-16 18:19:35 +0000
commita1d598399146984c99baa46db148e87c75261033 (patch)
treea2572fd8f9c9f76e746ee04f7fc5dd46f1fe44f9 /lib/inet_pton.c
parent4894ce16fc7af89d876e2f70db4dded7e1663198 (diff)
use macros ERRNO, SET_ERRNO(), SOCKERRNO and SET_SOCKERRNO() for errno handling
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 */