From af0216251b94e751baa47146ac9609db70793b8e Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Mon, 19 Jun 2017 00:52:38 -0400 Subject: 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 --- lib/parsedate.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/parsedate.c') diff --git a/lib/parsedate.c b/lib/parsedate.c index 3c783be48..609fd5363 100644 --- a/lib/parsedate.c +++ b/lib/parsedate.c @@ -404,12 +404,12 @@ static int parsedate(const char *date, time_t *output) int error; int old_errno; - old_errno = ERRNO; - SET_ERRNO(0); + old_errno = errno; + errno = 0; lval = strtol(date, &end, 10); - error = ERRNO; - if(error != old_errno) - SET_ERRNO(old_errno); + error = errno; + if(errno != old_errno) + errno = old_errno; if(error) return PARSEDATE_FAIL; -- cgit v1.2.3