From: Daniel Stenberg Date: Thu, 25 Mar 2004 07:33:11 +0000 (+0000) Subject: Always include setup.h as the first header file. X-Git-Tag: curl-7_11_2~199 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=accc6eb91acbf6e810aa2e88fa112e4baacb65a7;p=thirdparty%2Fcurl.git Always include setup.h as the first header file. Added a more verbose comment about what strerror_r() can set errno to in case of failure. This file still doesn't build on Solaris due to a missing 'sys_nerr' symbol. --- diff --git a/lib/curl_strerror.c b/lib/curl_strerror.c index ac08978f5a..1152aca4c3 100644 --- a/lib/curl_strerror.c +++ b/lib/curl_strerror.c @@ -20,8 +20,9 @@ * ***************************************************************************/ -#include #include "setup.h" + +#include #include #include #include @@ -503,7 +504,10 @@ const char *Curl_strerror(struct connectdata *conn, int err) if (err >= 0 && err < sys_nerr) { /* These should be atomic and hopefully thread-safe */ #ifdef HAVE_STRERROR_R - strerror_r(err, buf, max); /* this may set ERANGE! */ + strerror_r(err, buf, max); + /* this may set errno to ERANGE if insufficient storage was supplied via + strerrbuf and buflen to contain the generated message string, or EINVAL + if the value of errnum is not a valid error number.*/ #else strncpy(buf, strerror(err), max); #endif