diff options
author | frosch <frosch@openttd.org> | 2015-08-20 20:47:45 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2015-08-20 20:47:45 +0000 |
commit | 611478850886e1f7d973661cd08830c4c24190af (patch) | |
tree | 006ac727216dc713ebb00f4ee695e5b8e70ca71f /src | |
parent | 98acf32c6d7a2fdd82e4a48a0585c05a2803d529 (diff) | |
download | openttd-611478850886e1f7d973661cd08830c4c24190af.tar.xz |
(svn r27389) -Fix: There are two different availability conditions for fdatasync in the manpage. Use them both, since at least on some MinGW versions one is not enough.
Diffstat (limited to 'src')
-rw-r--r-- | src/ini.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/ini.cpp b/src/ini.cpp index ccce19239..905ebfacf 100644 --- a/src/ini.cpp +++ b/src/ini.cpp @@ -16,7 +16,6 @@ #include "fileio_func.h" #if (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309L) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 500) -# define WITH_FDATASYNC # include <unistd.h> #endif @@ -80,7 +79,7 @@ bool IniFile::SaveToDisk(const char *filename) * APIs to do so. We only need to flush the data as the metadata itself * (modification date etc.) is not important to us; only the real data is. */ -#ifdef WITH_FDATASYNC +#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0 int ret = fdatasync(fileno(f)); fclose(f); if (ret != 0) return false; |