Utils: Make sure we only use fdatasync() on systems that have it.

Change-Id: I7260c05081942acd5ecd7c66e864d4efc5041add
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
Christian Kandeler
2013-02-06 16:56:20 +01:00
parent 2c61945104
commit 1b6f89b417

View File

@@ -102,10 +102,10 @@ bool SaveFile::commit()
}
#ifdef Q_OS_WIN
FlushFileBuffers(reinterpret_cast<HANDLE>(handle()));
#elif defined(Q_OS_MAC)
fsync(handle());
#else
#elif _POSIX_SYNCHRONIZED_IO > 0
fdatasync(handle());
#else
fsync(handle());
#endif
close();
if (error() != NoError) {