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=ae7f66b45028a20104e22215d13334f8c19ebd6e;p=rrdtool.git fixed strerror_r usage ... #85 git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@1020 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_thread_safe.c b/src/rrd_thread_safe.c index 2ce649b..2b16876 100644 --- a/src/rrd_thread_safe.c +++ b/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