summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2003-11-02 15:55:02 +0200
committerunknown <monty@mysql.com>2003-11-02 15:55:02 +0200
commitc97a38c4d3b2afd4c93771fca61eede965fe71cf (patch)
treecb9bb7181d68f8c4f3d892367e08536d2f609a19 /myisam
parent116cf0102464ce330a758fa3bec2239bfc5872d5 (diff)
downloadmariadb-git-c97a38c4d3b2afd4c93771fca61eede965fe71cf.tar.gz
Call my_sync() after all data is written to .frm file
Added my_sync() to mysys which will do fsync/fdatasync/_commit() on a file. VC++Files/mysys/mysys.dsp: Added my_sync.c configure.in: Added testing of fsync and fdatasync include/my_sys.h: Added my_sync() include/mysys_err.h: Added my_sync() isam/extra.c: Added my_sync() myisam/mi_extra.c: Added my_sync() myisam/mi_locking.c: Added my_sync() mysql-test/mysql-test-run.sh: Added option --valgrind-all mysys/Makefile.am: Added my_sync.c mysys/errors.c: Added my_sync() mysys/my_symlink.c: Removed compiler warning mysys/thr_alarm.c: Fix for link error on windows sql/unireg.cc: Call my_sync() after all data is written to .frm file BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_extra.c20
-rw-r--r--myisam/mi_locking.c20
2 files changed, 8 insertions, 32 deletions
diff --git a/myisam/mi_extra.c b/myisam/mi_extra.c
index ef82a6ef61f..1d45fd300e7 100644
--- a/myisam/mi_extra.c
+++ b/myisam/mi_extra.c
@@ -336,22 +336,10 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
if (share->not_flushed)
{
share->not_flushed=0;
-#if defined(__WIN__)
- if (_commit(share->kfile))
- error=errno;
- if (_commit(info->dfile))
- error=errno;
-#elif defined(HAVE_FDATASYNC)
- if (fdatasync(share->kfile))
- error=errno;
- if (fdatasync(share->dfile))
- error=errno;
-#elif defined(HAVE_FSYNC)
- if ( fsync(share->kfile))
- error=errno;
- if (fsync(share->dfile))
- error=errno;
-#endif
+ if (my_sync(share->kfile, MYF(0)))
+ error= my_errno;
+ if (my_sync(info->dfile, MYF(0)))
+ error= my_errno;
if (error)
{
share->changed=1;
diff --git a/myisam/mi_locking.c b/myisam/mi_locking.c
index a707eb294a9..f3bfa8deb90 100644
--- a/myisam/mi_locking.c
+++ b/myisam/mi_locking.c
@@ -88,22 +88,10 @@ int mi_lock_database(MI_INFO *info, int lock_type)
share->changed=0;
if (myisam_flush)
{
-#if defined(__WIN__)
- if (_commit(share->kfile))
- error=errno;
- if (_commit(info->dfile))
- error=errno;
-#elif defined(HAVE_FDATASYNC)
- if (fdatasync(share->kfile))
- error=errno;
- if (fdatasync(share->dfile))
- error=errno;
-#elif defined(HAVE_FSYNC)
- if (fsync(share->kfile))
- error=errno;
- if (fsync(share->dfile))
- error=errno;
-#endif
+ if (my_sync(share->kfile, MYF(0)))
+ error= my_errno;
+ if (my_sync(info->dfile, MYF(0)))
+ error= my_errno;
}
else
share->not_flushed=1;