int r = 0;
dout(1) << __func__ << " path " << path << dendl;
- fd_direct = ::open(path.c_str(), O_RDWR | O_DIRECT);
+ fd_direct = ::open(path.c_str(), O_RDWR | O_DIRECT | O_CLOEXEC);
if (fd_direct < 0) {
r = -errno;
derr << __func__ << " open got: " << cpp_strerror(r) << dendl;
return r;
}
- fd_buffered = ::open(path.c_str(), O_RDWR);
+ fd_buffered = ::open(path.c_str(), O_RDWR | O_CLOEXEC);
if (fd_buffered < 0) {
r = -errno;
derr << __func__ << " open got: " << cpp_strerror(r) << dendl;
dout(1) << __func__
<< " size " << size
<< " (0x" << std::hex << size << std::dec << ", "
- << pretty_si_t(size) << "B)"
+ << byte_u_t(size) << ")"
<< " block_size " << block_size
- << " (" << pretty_si_t(block_size) << "B)"
+ << " (" << byte_u_t(block_size) << ")"
<< " " << (rotational ? "rotational" : "non-rotational")
<< dendl;
return 0;