]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commit
Even though POSIX/XSI requires "strerror_r" to return an "int", some systems
authorTobias Oetiker <tobi@oetiker.ch>
Fri, 6 Mar 2009 05:39:37 +0000 (05:39 +0000)
committerTobias Oetiker <tobi@oetiker.ch>
Fri, 6 Mar 2009 05:39:37 +0000 (05:39 +0000)
commitf4f9f9c4a4935331cf7321bf48d8707966b7448a
treeff5dda0b2054c16cd849064b53ed0bfb7bf6818d
parent42dcfe7c143d2dda465a8fd84273e58ff4bb8ffa
Even though POSIX/XSI requires "strerror_r" to return an "int", some systems
(e.g. the GNU libc) return a "char *" _and_ ignore the second argument (user
provided buffer). The configure script now checks for that behavior using
AC_FUNC_STRERROR_R. rrd_strerror() in rrd_thread_safe.c has been updated to
(hopefully) handle all possible cases.

Previously, rrd_strerror() would have returned "strerror_r failed. sorry!" in
mostly any cases when using glibc, since "if (strerror_r())" had been used to
check for errors which evaluates to true if a (non-NULL) pointer was returned.

Now, we, at least, return the error number in case anything else fails.

Thanks to Alessandro Iurlano for reporting this issue after spotting it in
collectd <http://collectd.org>.

patch by Sebastian Harl

git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1752 a5681a0c-68f1-0310-ab6d-d61299d08faa
configure.ac
src/rrd_thread_safe.c