| 177 | |
| 178 | #if FMT_USE_FCNTL |
| 179 | file::file(cstring_view path, int oflag) { |
| 180 | int mode = S_IRUSR | S_IWUSR; |
| 181 | # if defined(_WIN32) && !defined(__MINGW32__) |
| 182 | fd_ = -1; |
| 183 | FMT_POSIX_CALL(sopen_s(&fd_, path.c_str(), oflag, _SH_DENYNO, mode)); |
| 184 | # else |
| 185 | FMT_RETRY(fd_, FMT_POSIX_CALL(open(path.c_str(), oflag, mode))); |
| 186 | # endif |
| 187 | if (fd_ == -1) |
| 188 | FMT_THROW(system_error(errno, "cannot open file {}", path.c_str())); |
| 189 | } |
| 190 | |
| 191 | file::~file() FMT_NOEXCEPT { |
| 192 | // Don't retry close in case of EINTR! |
nothing calls this directly
no test coverage detected