commit 4a69657dceac767a16ea7e91d6c7df0f13bbb42f
parent f7b0b7c7aca8a59fb13f24a2673f8781afbae27b
Author: Joris Vink <joris@coders.se>
Date: Thu, 25 Feb 2016 22:04:24 +0100
Don't call close on an fd that is -1.
Diffstat:
src/domain.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/domain.c b/src/domain.c
@@ -254,8 +254,11 @@ kore_domain_closelogs(void)
{
struct kore_domain *dom;
- TAILQ_FOREACH(dom, &domains, list)
- close(dom->accesslog);
+ TAILQ_FOREACH(dom, &domains, list) {
+ if (dom->accesslog != -1) {
+ (void)close(dom->accesslog);
+ }
+ }
}
void