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 --- src/tool_paramhlp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/tool_paramhlp.c') diff --git a/src/tool_paramhlp.c b/src/tool_paramhlp.c index 6b534ce5d..ee37931b8 100644 --- a/src/tool_paramhlp.c +++ b/src/tool_paramhlp.c @@ -383,11 +383,11 @@ ParameterError str2offset(curl_off_t *val, const char *str) #if(CURL_SIZEOF_CURL_OFF_T > CURL_SIZEOF_LONG) *val = curlx_strtoofft(str, &endptr, 0); - if((*val == CURL_OFF_T_MAX || *val == CURL_OFF_T_MIN) && (ERRNO == ERANGE)) + if((*val == CURL_OFF_T_MAX || *val == CURL_OFF_T_MIN) && (errno == ERANGE)) return PARAM_BAD_NUMERIC; #else *val = strtol(str, &endptr, 0); - if((*val == LONG_MIN || *val == LONG_MAX) && ERRNO == ERANGE) + if((*val == LONG_MIN || *val == LONG_MAX) && errno == ERANGE) return PARAM_BAD_NUMERIC; #endif if((endptr != str) && (endptr == str + strlen(str))) -- cgit v1.2.3