Close fds only once, thanks to @disaykin

This commit is contained in:
Soner Tari 2023-05-18 00:47:47 +03:00
parent d45e9a2f92
commit 1408e85513

View File

@ -303,7 +303,9 @@ log_masterkey_writecb(UNUSED int level, UNUSED void *fh, UNUSED unsigned long ct
static void
log_masterkey_fini(void)
{
close(masterkey_fd);
if (masterkey_fd != -1)
close(masterkey_fd);
masterkey_fd = -1;
}
/*
@ -389,7 +391,9 @@ log_connect_writecb(UNUSED int level, UNUSED void *fh, UNUSED unsigned long ctl,
static void
log_connect_fini(void)
{
close(connect_fd);
if (connect_fd != -1)
close(connect_fd);
connect_fd = -1;
}
static int