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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Attachment: signature.asc
Description: This is a digitally signed message part.

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux