Marked fds to close on exec. (#122)

This commit is contained in:
Ravin Perera
2020-09-18 11:40:03 +05:30
committed by GitHub
parent f622a252e6
commit 180b1ec714
5 changed files with 45 additions and 38 deletions

View File

@@ -381,7 +381,7 @@ namespace comm
ss << "/proc/" << uc.pid << "/environ";
std::string fn = ss.str();
const int envfd = open(fn.c_str(), O_RDONLY);
const int envfd = open(fn.c_str(), O_RDONLY | O_CLOEXEC);
if (!envfd)
{
LOG_ERR << errno << ": Could not open environ block for process on other end of unix domain socket PID=" << uc.pid;