extern "C" bool configParse(struct nsjconf_t* nsjconf, const char* file) {
LOG_I("Parsing configuration from '%s'", file);
- int fd = open(file, O_RDONLY);
+ int fd = open(file, O_RDONLY | O_CLOEXEC);
if (fd == -1) {
PLOG_W("Couldn't open config file '%s'", file);
return false;
static bool containMakeFdsCOEProc(struct nsjconf_t* nsjconf) {
int dirfd = open("/proc/self/fd", O_DIRECTORY | O_RDONLY | O_CLOEXEC);
if (dirfd == -1) {
- PLOG_D("open('/proc/self/fd', O_DIRECTORY|O_RDONLY)");
+ PLOG_D("open('/proc/self/fd', O_DIRECTORY|O_RDONLY|O_CLOEXEC)");
return false;
}
DIR* dir = fdopendir(dirfd);