mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-24 06:32:06 +08:00
Update os-inl.h
This commit is contained in:
parent
435827fe5a
commit
78e86ba01f
@ -602,14 +602,14 @@ std::string SPDLOG_INLINE getenv(const char *field)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do fsync by FILE descriptor
|
// Do fsync by FILE handlerpointer
|
||||||
// Return true on success
|
// Return true on success
|
||||||
SPDLOG_INLINE bool fsync(FILE *fd)
|
SPDLOG_INLINE bool fsync(FILE *fp)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
return FlushFileBuffers(reinterpret_cast<HANDLE>(_get_osfhandle(_fileno(fd)))) != 0;
|
return FlushFileBuffers(reinterpret_cast<HANDLE>(_get_osfhandle(_fileno(fp)))) != 0;
|
||||||
#else
|
#else
|
||||||
return ::fsync(fileno(fd)) == 0;
|
return ::fsync(fileno(fp)) == 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user