From 89f449aa01c1fb787ea6ed4ccca237114c8f85b0 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Sun, 27 Sep 2015 01:25:07 -0700 Subject: common: set log file fd to close on exec --- common/log.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'common') diff --git a/common/log.c b/common/log.c index e196021a..b3ae9c22 100644 --- a/common/log.c +++ b/common/log.c @@ -59,6 +59,13 @@ internal_log_file_open(const char *fname) S_IRUSR | S_IWUSR); } +#ifdef FD_CLOEXEC + if (ret != -1) + { + fcntl(ret, F_SETFD, FD_CLOEXEC); + } +#endif + return ret; } -- cgit v1.2.1