From 128a01f32bf6828246ca6f39c8379ffd4e4c031f Mon Sep 17 00:00:00 2001 From: oetiker Date: Thu, 15 Mar 2007 21:03:51 +0000 Subject: [PATCH] fixed strerror_r usage ... #85 git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@1020 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_thread_safe.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.30.2