From: Howard Chu Date: Tue, 11 Dec 2012 20:55:47 +0000 (-0800) Subject: Make sure init_meta is at beginning of file X-Git-Tag: OPENLDAP_REL_ENG_2_4_34~80^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9acf801cc119d187e1252474cab7d228dc6d7676;p=openldap Make sure init_meta is at beginning of file --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 4492a76030..e6f75406e1 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -2518,10 +2518,12 @@ mdb_env_init_meta(MDB_env *env, MDB_meta *meta) #ifdef _WIN32 { DWORD len; + SetFilePointer(env->me_fd, 0, NULL, FILE_BEGIN); rc = WriteFile(env->me_fd, p, psize * 2, &len, NULL); rc = (len == psize * 2) ? MDB_SUCCESS : ErrCode(); } #else + lseek(env->me_fd, 0, SEEK_SET); rc = write(env->me_fd, p, psize * 2); rc = (rc == (int)psize * 2) ? MDB_SUCCESS : ErrCode(); #endif