]> git.sur5r.net Git - openldap/commitdiff
libmdb: MDB_FDATASYNC code cleanup.
authorHallvard Furuseth <hallvard@openldap.org>
Thu, 12 Apr 2012 05:34:13 +0000 (07:34 +0200)
committerHallvard Furuseth <hallvard@openldap.org>
Thu, 12 Apr 2012 06:15:33 +0000 (08:15 +0200)
Define MDB_FDATASYNC() instead of redefining fdatasync().

libraries/libmdb/mdb.c

index cd3a7598772ace9987fbce714715bbd2427be65d..f74adbea38dfa45bec762ff1df6ce67bc9604ec2 100644 (file)
 #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)
 #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.
         */