From: Hallvard Furuseth Date: Thu, 12 Apr 2012 05:34:13 +0000 (+0200) Subject: libmdb: MDB_FDATASYNC code cleanup. X-Git-Tag: OPENLDAP_REL_ENG_2_4_32~125^2~8 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=99fa22c164438e6845ecd0878b02afb8069cdf9e;p=openldap libmdb: MDB_FDATASYNC code cleanup. Define MDB_FDATASYNC() instead of redefining fdatasync(). --- diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index cd3a759877..f74adbea38 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -144,7 +144,7 @@ #define LOCK_MUTEX_W(env) pthread_mutex_lock((env)->me_wmutex) #define UNLOCK_MUTEX_W(env) pthread_mutex_unlock((env)->me_wmutex) #define getpid() GetCurrentProcessId() -#define fdatasync(fd) (!FlushFileBuffers(fd)) +#define MDB_FDATASYNC(fd) (!FlushFileBuffers(fd)) #define ErrCode() GetLastError() #define GET_PAGESIZE(x) {SYSTEM_INFO si; GetSystemInfo(&si); (x) = si.dwPageSize;} #define close(fd) CloseHandle(fd) @@ -155,10 +155,10 @@ #define UNLOCK_MUTEX_R(env) sem_post((env)->me_rmutex) #define LOCK_MUTEX_W(env) sem_wait((env)->me_wmutex) #define UNLOCK_MUTEX_W(env) sem_post((env)->me_wmutex) -#define fdatasync(fd) fsync(fd) +#define MDB_FDATASYNC(fd) fsync(fd) #else #ifdef ANDROID -#define fdatasync(fd) fsync(fd) +#define MDB_FDATASYNC(fd) fsync(fd) #endif /** Lock the reader mutex. */