From 2b9062b44e771d296117d7f1fa0cabf4abcffc67 Mon Sep 17 00:00:00 2001 From: ckolivas Date: Wed, 18 Jun 2014 09:53:29 +1000 Subject: [PATCH] Only show errno if it's not zero --- src/ckpool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ckpool.c b/src/ckpool.c index 8abb2a35..cf26c06f 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -58,7 +58,7 @@ void logmsg(int loglevel, const char *fmt, ...) { tm->tm_min, tm->tm_sec, buf); - if (loglevel <= LOG_ERR) + if (loglevel <= LOG_ERR && errno != 0) fprintf(LOGFP, " with errno %d: %s", errno, strerror(errno)); fprintf(LOGFP, "\n"); fflush(LOGFP); @@ -66,7 +66,7 @@ void logmsg(int loglevel, const char *fmt, ...) { } if (loglevel <= LOG_WARNING) {\ fprintf(stderr, "%s", buf); - if (loglevel <= LOG_ERR) + if (loglevel <= LOG_ERR && errno != 0) fprintf(stderr, " with errno %d: %s", errno, strerror(errno)); fprintf(stderr, "\n"); fflush(stderr);