From ae7f66b45028a20104e22215d13334f8c19ebd6e 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/program@1020 a5681a0c-68f1-0310-ab6d-d61299d08faa --- src/rrd_thread_safe.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.30.2