[libvirt] [PATCH 09/23] util: introduce virFileDataSync

Pino Toscano ptoscano at redhat.com
Mon Jan 6 09:13:51 UTC 2020


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200106/59a3d8c0/attachment-0001.sig>


More information about the libvir-list mailing list