summaryrefslogtreecommitdiff
path: root/mysys/my_sync.c
diff options
context:
space:
mode:
authorMikael Ronstrom <mikael@dator8>2011-01-04 18:46:01 +0100
committerMikael Ronstrom <mikael@dator8>2011-01-04 18:46:01 +0100
commit6e7752d557aa0d77e49299eefa04136fe45bbb11 (patch)
tree3099d3c6d9977c59627e466389081f2dae42b159 /mysys/my_sync.c
parentd0182e61a189fada37c19281c69fd4824e6092a8 (diff)
parentee46dc0f23e45104071b35ff18b9ea5a20a23a2a (diff)
downloadmariadb-git-6e7752d557aa0d77e49299eefa04136fe45bbb11.tar.gz
merge
Diffstat (limited to 'mysys/my_sync.c')
-rw-r--r--mysys/my_sync.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/mysys/my_sync.c b/mysys/my_sync.c
index 6a4e26a6542..3ca57055470 100644
--- a/mysys/my_sync.c
+++ b/mysys/my_sync.c
@@ -70,7 +70,7 @@ int my_sync(File fd, myf my_flags)
/* Some file systems don't support F_FULLFSYNC and fail above: */
DBUG_PRINT("info",("fcntl(F_FULLFSYNC) failed, falling back"));
#endif
-#if defined(HAVE_FDATASYNC)
+#if defined(HAVE_FDATASYNC) && HAVE_DECL_FDATASYNC
res= fdatasync(fd);
#elif defined(HAVE_FSYNC)
res= fsync(fd);
@@ -108,6 +108,8 @@ int my_sync(File fd, myf my_flags)
static const char cur_dir_name[]= {FN_CURLIB, 0};
+
+
/*
Force directory information to disk.
@@ -119,7 +121,9 @@ static const char cur_dir_name[]= {FN_CURLIB, 0};
RETURN
0 if ok, !=0 if error
*/
+
#ifdef NEED_EXPLICIT_SYNC_DIR
+
int my_sync_dir(const char *dir_name, myf my_flags)
{
File dir_fd;
@@ -144,12 +148,15 @@ int my_sync_dir(const char *dir_name, myf my_flags)
res= 1;
DBUG_RETURN(res);
}
+
#else /* NEED_EXPLICIT_SYNC_DIR */
+
int my_sync_dir(const char *dir_name __attribute__((unused)),
- myf my_flags __attribute__((unused)))
+ myf my_flags __attribute__((unused)))
{
return 0;
}
+
#endif /* NEED_EXPLICIT_SYNC_DIR */
@@ -164,7 +171,9 @@ int my_sync_dir(const char *dir_name __attribute__((unused)),
RETURN
0 if ok, !=0 if error
*/
+
#ifdef NEED_EXPLICIT_SYNC_DIR
+
int my_sync_dir_by_file(const char *file_name, myf my_flags)
{
char dir_name[FN_REFLEN];
@@ -172,10 +181,14 @@ int my_sync_dir_by_file(const char *file_name, myf my_flags)
dirname_part(dir_name, file_name, &dir_name_length);
return my_sync_dir(dir_name, my_flags);
}
+
#else /* NEED_EXPLICIT_SYNC_DIR */
+
int my_sync_dir_by_file(const char *file_name __attribute__((unused)),
- myf my_flags __attribute__((unused)))
+ myf my_flags __attribute__((unused)))
{
return 0;
}
+
#endif /* NEED_EXPLICIT_SYNC_DIR */
+