diff options
author | Jay Satiro <raysatiro@yahoo.com> | 2017-06-19 00:52:38 -0400 |
---|---|---|
committer | Jay Satiro <raysatiro@yahoo.com> | 2017-07-10 02:09:27 -0400 |
commit | af0216251b94e751baa47146ac9609db70793b8e (patch) | |
tree | de39c7130d519f0bcda17b9a09df822f02fc32e6 /lib/asyn-thread.c | |
parent | 17da6750026cf00277aad3a44fd20b1a4cea6406 (diff) | |
download | curl-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/asyn-thread.c')
-rw-r--r-- | lib/asyn-thread.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c index 4250e276a..8936b6033 100644 --- a/lib/asyn-thread.c +++ b/lib/asyn-thread.c @@ -407,9 +407,7 @@ static bool init_resolve_thread(struct connectdata *conn, #endif if(!td->thread_hnd) { -#ifndef _WIN32_WCE err = errno; -#endif goto err_exit; } @@ -418,8 +416,7 @@ static bool init_resolve_thread(struct connectdata *conn, err_exit: destroy_async_data(&conn->async); - SET_ERRNO(err); - + errno = err; return FALSE; } @@ -655,7 +652,7 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn, /* fall-back to blocking version */ infof(conn->data, "init_resolve_thread() failed for %s; %s\n", - hostname, Curl_strerror(conn, ERRNO)); + hostname, Curl_strerror(conn, errno)); error = Curl_getaddrinfo_ex(hostname, sbuf, &hints, &res); if(error) { |