Util: Detect futimens/futimes instead of guessing

This commit is contained in:
Vicki Pfau 2021-07-13 21:34:46 -07:00
parent de4ea9284d
commit 74758fc3c3
2 changed files with 5 additions and 2 deletions

View File

@ -317,6 +317,9 @@ find_function(setlocale)
find_function(snprintf_l) find_function(snprintf_l)
find_function(uselocale) find_function(uselocale)
find_function(futimens)
find_function(futimes)
if(ANDROID AND ANDROID_NDK_MAJOR GREATER 13) if(ANDROID AND ANDROID_NDK_MAJOR GREATER 13)
set(HAVE_STRTOF_L ON) set(HAVE_STRTOF_L ON)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")

View File

@ -200,9 +200,9 @@ static bool _vfdSync(struct VFile* vf, void* buffer, size_t size) {
UNUSED(size); UNUSED(size);
struct VFileFD* vfd = (struct VFileFD*) vf; struct VFileFD* vfd = (struct VFileFD*) vf;
#ifndef _WIN32 #ifndef _WIN32
#ifdef __HAIKU__ #ifdef HAVE_FUTIMENS
futimens(vfd->fd, NULL); futimens(vfd->fd, NULL);
#else #elif defined(HAVE_FUTIMES)
futimes(vfd->fd, NULL); futimes(vfd->fd, NULL);
#endif #endif
if (buffer && size) { if (buffer && size) {