aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-02-15 18:44:32 +0000
committerYang Tse <yangsita@gmail.com>2007-02-15 18:44:32 +0000
commit6663608d15226110b106f7dc9e995eb94cddeddc (patch)
treec106a742ad0c8a28eb136ca51b3b824ba19f31af /lib
parentd21e4eb8ae10d704a01cfd0278f4efd636842457 (diff)
avoid redefinition of SET_ERRNO()
Diffstat (limited to 'lib')
-rw-r--r--lib/inet_ntop.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/inet_ntop.c b/lib/inet_ntop.c
index 9381963f5..f41a3f268 100644
--- a/lib/inet_ntop.c
+++ b/lib/inet_ntop.c
@@ -57,9 +57,6 @@
#ifdef USE_WINSOCK
#define EAFNOSUPPORT WSAEAFNOSUPPORT
-#define SET_ERRNO(e) WSASetLastError(errno = (e))
-#else
-#define SET_ERRNO(e) errno = e
#endif
/*
@@ -204,8 +201,14 @@ static char *inet_ntop6 (const unsigned char *src, char *dst, size_t size)
/*
* Convert a network format address to presentation format.
*
- * Returns pointer to presentation format address (`buf'),
- * Returns NULL on error (see errno).
+ * Returns pointer to presentation format address (`buf').
+ * Returns NULL on error and errno set with the specific
+ * error, EAFNOSUPPORT or ENOSPC.
+ *
+ * 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 NULL, not SOCKERRNO.
*/
char *Curl_inet_ntop(int af, const void *src, char *buf, size_t size)
{