We do not check metadata - mtime, atime, anywhere, so we
do not need to update it every time we sync the log.
if the system supports it, the log update should be
data only
Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Signed-off-by: William Tu <u9012063@gmail.com>
struct ovsdb_error *
ovsdb_log_commit_block(struct ovsdb_log *file)
{
+#if (_POSIX_C_SOURCE >= 199309L || _XOPEN_SOURCE >= 500)
+ /* we do not check metadata - mtime, atime, anywhere, so we
+ * do not need to update it every time we sync the log.
+ * if the system supports it, the log update should be
+ * data only
+ */
+ if (file->stream && fdatasync(fileno(file->stream))) {
+#else
if (file->stream && fsync(fileno(file->stream))) {
+#endif
return ovsdb_io_error(errno, "%s: fsync failed", file->display_name);
}
return NULL;