Add missing O_RDONLY here and there
This commit is contained in:
parent
19ea0703f2
commit
d7cb58e280
@ -309,7 +309,7 @@ static void LogHandler(
|
|||||||
extern "C" bool configParse(struct nsjconf_t* nsjconf, const char* file) {
|
extern "C" bool configParse(struct nsjconf_t* nsjconf, const char* file) {
|
||||||
LOG_I("Parsing configuration from '%s'", 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) {
|
if (fd == -1) {
|
||||||
PLOG_W("Couldn't open config file '%s'", file);
|
PLOG_W("Couldn't open config file '%s'", file);
|
||||||
return false;
|
return false;
|
||||||
|
@ -178,7 +178,7 @@ static bool containMakeFdsCOENaive(struct nsjconf_t* nsjconf) {
|
|||||||
static bool containMakeFdsCOEProc(struct nsjconf_t* nsjconf) {
|
static bool containMakeFdsCOEProc(struct nsjconf_t* nsjconf) {
|
||||||
int dirfd = open("/proc/self/fd", O_DIRECTORY | O_RDONLY | O_CLOEXEC);
|
int dirfd = open("/proc/self/fd", O_DIRECTORY | O_RDONLY | O_CLOEXEC);
|
||||||
if (dirfd == -1) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
DIR* dir = fdopendir(dirfd);
|
DIR* dir = fdopendir(dirfd);
|
||||||
|
Loading…
Reference in New Issue
Block a user