author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 6 Mar 2009 05:39:37 +0000 (05:39 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 6 Mar 2009 05:39:37 +0000 (05:39 +0000) | ||
commit | a46043b54ab19ce6dcf2f0a0cb11cea44518e18c | |
tree | 26f41079364b1f05a26c400bf9ce4bb8e2c98276 | tree | snapshot |
parent | f0571a11c9003c2b5ec393499679fe353f49a715 | commit | diff |
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@1752 a5681a0c-68f1-0310-ab6d-d61299d08faa
(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@1752 a5681a0c-68f1-0310-ab6d-d61299d08faa
program/configure.ac | diff | blob | history | |
program/src/rrd_thread_safe.c | diff | blob | history |