--- lbbs/src/log.c 2025/11/05 04:19:21 1.30 +++ lbbs/src/log.c 2025/11/16 00:19:42 1.32 @@ -6,6 +6,10 @@ * Copyright (C) 2004-2025 Leaflet */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "common.h" #include "io.h" #include "log.h" @@ -91,16 +95,10 @@ int log_printf(enum log_level_t log_leve int log_common_redir(int fd) { - int ret; - close(fileno(fp_common_log)); - ret = dup2(fd, fileno(fp_common_log)); - return ret; + return dup2(fd, fileno(fp_common_log)); } int log_error_redir(int fd) { - int ret; - close(fileno(fp_error_log)); - ret = dup2(fd, fileno(fp_error_log)); - return ret; + return dup2(fd, fileno(fp_error_log)); }