Merge branch 'cloexec-errorlog'

This commit is contained in:
Michael Stapelberg 2011-10-01 17:44:43 +01:00
commit 1f472b0962

View File

@ -16,6 +16,8 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/time.h> #include <sys/time.h>
#include <unistd.h>
#include <fcntl.h>
#include "util.h" #include "util.h"
#include "log.h" #include "log.h"
@ -41,6 +43,9 @@ void init_logging() {
} }
errorfile = fopen(errorfilename, "w"); errorfile = fopen(errorfilename, "w");
if (fcntl(fileno(errorfile), F_SETFD, FD_CLOEXEC)) {
ELOG("Could not set close-on-exec flag\n");
}
} }
/* /*