
6 Jan
2020
6 Jan
'20
9:13 a.m.
On Thursday, 2 January 2020 15:53:43 CET Daniel P. Berrangé wrote:
A wrapper that calls g_fsync on Win32/macOS and fdatasync elsewhere. g_fsync is a stronger flush than we need but it satisfies the caller's requirements & matches the approach gnulib takes.
[...] +int +virFileDataSync(int fd) +{ +#if defined(__APPLE__) || defined(WIN32) + return g_fsync(fd); +#else + return fdatasync(fd); +#endif
Why not just simply add a configure check for the fdatasync function? This way there is no need to hardcode OSes/platforms. -- Pino Toscano