common: set log file fd to close on exec

This commit is contained in:
Jay Sorg 2015-09-27 01:25:07 -07:00
parent 7695f3d87b
commit 89f449aa01
1 changed files with 7 additions and 0 deletions

View File

@ -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;
}