diff --git a/src/log.c b/src/log.c index d424ffd3..5e1c35eb 100644 --- a/src/log.c +++ b/src/log.c @@ -16,6 +16,8 @@ #include #include #include +#include +#include #include "util.h" #include "log.h" @@ -41,6 +43,9 @@ void init_logging() { } errorfile = fopen(errorfilename, "w"); + if (fcntl(fileno(errorfile), F_SETFD, FD_CLOEXEC)) { + ELOG("Could not set close-on-exec flag\n"); + } } /*