From 5784c8ff0c425b0948b653541c58fb8493515aa7 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Thu, 6 Jun 2013 10:08:55 -0400 Subject: [PATCH] logger: don't close already logger if already closed This prevents close(-1) from showing up in strace --- src/libply/ply-logger.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libply/ply-logger.c b/src/libply/ply-logger.c index 5ea0b5e..ec5b6e5 100644 --- a/src/libply/ply-logger.c +++ b/src/libply/ply-logger.c @@ -357,6 +357,9 @@ ply_logger_close_file (ply_logger_t *logger) { assert (logger != NULL); + if (logger->output_fd < 0) + return; + close (logger->output_fd); ply_logger_set_output_fd (logger, -1); } -- 1.8.1.4