From: oetiker Date: Thu, 15 Mar 2007 21:03:51 +0000 (+0000) Subject: fixed strerror_r usage ... #85 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=128a01f32bf6828246ca6f39c8379ffd4e4c031f;p=rrdtool-all.git fixed strerror_r usage ... #85 git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@1020 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/src/rrd_thread_safe.c b/program/src/rrd_thread_safe.c index 2ce649ba..2b168766 100644 --- a/program/src/rrd_thread_safe.c +++ b/program/src/rrd_thread_safe.c @@ -51,7 +51,10 @@ struct rrd_context *rrd_get_context(void) { #ifdef HAVE_STRERROR_R const char *rrd_strerror(int err) { struct rrd_context *ctx = rrd_get_context(); - return strerror_r(err, ctx->lib_errstr, ctx->errlen); + if (strerror_r(err, ctx->lib_errstr, ctx->errlen)) + return "strerror_r faild. sorry!"; + else + return ctx->lib_errstr; } #else #undef strerror