diff options
author | unknown <serg@sergbook.mysql.com> | 2005-01-06 17:40:00 +0200 |
---|---|---|
committer | unknown <serg@sergbook.mysql.com> | 2005-01-06 17:40:00 +0200 |
commit | 18cb4bda507766d028f46f4369ab836aa7ee1462 (patch) | |
tree | a623d3e82efd887c87ed3b4e00b0259e047614cf /innobase | |
parent | df00fac516a21caff3fce24b78ecaf3e1999078e (diff) | |
parent | 8ead56a33800e6be5cda1418946dc5f8e1b890f5 (diff) | |
download | mariadb-git-18cb4bda507766d028f46f4369ab836aa7ee1462.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into sergbook.mysql.com:/usr/home/serg/Abk/mysql-4.1
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/os/os0file.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index aa45030d93b..f02b81b8fd8 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -1763,7 +1763,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); */ |