Fix fopen_s error reporting with PREVENT_CHILD_FD

This commit is contained in:
Andrey Bugaevskiy
2022-03-11 19:22:45 +00:00
parent 7f8a61e79d
commit 5ee969e4f6
2 changed files with 13 additions and 1 deletions

View File

@@ -145,7 +145,7 @@ SPDLOG_INLINE bool fopen_s(FILE **fp, const filename_t &filename, const filename
const int fd = ::open((filename.c_str()), O_CREAT | O_WRONLY | O_CLOEXEC | mode_flag, mode_t(0644));
if (fd == -1)
{
return false;
return true;
}
*fp = ::fdopen(fd, mode.c_str());
if (*fp == nullptr)