summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authorunknown <serg@sergbook.mysql.com>2005-01-06 19:32:16 +0200
committerunknown <serg@sergbook.mysql.com>2005-01-06 19:32:16 +0200
commitb74ac39f6ee1cdf97ba1b748dfa48f7a481978da (patch)
treebc5f2396178536c669ed27714be84b79612c0f6b /innobase
parent52a756ce715ed9eea9c8c545bee1da5e92e95e7a (diff)
parent18cb4bda507766d028f46f4369ab836aa7ee1462 (diff)
downloadmariadb-git-b74ac39f6ee1cdf97ba1b748dfa48f7a481978da.tar.gz
merged
BitKeeper/etc/ignore: auto-union include/my_pthread.h: Auto merged innobase/os/os0file.c: Auto merged scripts/mysqld_safe.sh: Auto merged sql/set_var.cc: Auto merged sql/sql_parse.cc: Auto merged sql-common/client.c: merged manually
Diffstat (limited to 'innobase')
-rw-r--r--innobase/os/os0file.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c
index e0d822b016f..ed3c0e53c12 100644
--- a/innobase/os/os0file.c
+++ b/innobase/os/os0file.c
@@ -1767,7 +1767,21 @@ os_file_flush(
#else
int ret;
-#ifdef HAVE_FDATASYNC
+#ifdef HAVE_DARWIN_THREADS
+ /* Apple has disabled fsync() for internal disk drives in OS X. That
+ caused corruption for a user when he tested a power outage. Let us in
+ OS X use a nonstandard flush method recommended by an Apple
+ engineer. */
+
+ ret = fcntl(file, F_FULLFSYNC, NULL);
+
+ if (ret) {
+ /* If we are not on a file system that supports this, then
+ fall back to a plain fsync. */
+
+ ret = fsync(file);
+ }
+#elif HAVE_FDATASYNC
ret = fdatasync(file);
#else
/* fprintf(stderr, "Flushing to file %p\n", file); */