From c3ce5321b048cf5bc4799a0ecfc7545ac570add3 Mon Sep 17 00:00:00 2001 From: ckolivas Date: Wed, 18 Jun 2014 10:06:03 +1000 Subject: [PATCH] Only close the rotating log once --- src/libckpool.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libckpool.c b/src/libckpool.c index 34103d4f..5064abd1 100644 --- a/src/libckpool.c +++ b/src/libckpool.c @@ -866,13 +866,11 @@ bool rotating_log(const char *path, const char *msg) } if (unlikely(flock(fd, LOCK_EX))) { fclose(fp); - close(fd); LOGERR("Failed to flock %s in rotating_log!", filename); return false; } fprintf(fp, "%s\n", msg); fclose(fp); - close(fd); return true; }