int KStore::_open_path()
{
assert(path_fd < 0);
- path_fd = ::open(path.c_str(), O_DIRECTORY);
+ path_fd = ::open(path.c_str(), O_DIRECTORY|O_CLOEXEC);
if (path_fd < 0) {
int r = -errno;
derr << __func__ << " unable to open " << path << ": " << cpp_strerror(r)