From: Howard Chu Date: Tue, 13 Aug 2013 20:05:32 +0000 (-0700) Subject: Revert "ITS#7664 delete lockfile if there is no environment" X-Git-Tag: OPENLDAP_REL_ENG_2_4_36~1^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a77ffaaa5d19ed42a6087109a5fa078f78eaf3e1;p=openldap Revert "ITS#7664 delete lockfile if there is no environment" This reverts commit 8725838409512e999d78ea7b60773ce2f94d588f. --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index ae66ff41b0..6460173591 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -163,7 +163,6 @@ #define GET_PAGESIZE(x) {SYSTEM_INFO si; GetSystemInfo(&si); (x) = si.dwPageSize;} #define close(fd) (CloseHandle(fd) ? 0 : -1) #define munmap(ptr,len) UnmapViewOfFile(ptr) -#define unlink(file) DeleteFile(file) #ifdef PROCESS_QUERY_LIMITED_INFORMATION #define MDB_PROCESS_QUERY_LIMITED_INFORMATION PROCESS_QUERY_LIMITED_INFORMATION #else @@ -3852,7 +3851,7 @@ fail: int mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode) { - int oflags, rc, len, excl = -1, rmlock = 0; + int oflags, rc, len, excl = -1; char *lpath, *dpath; if (env->me_fd!=INVALID_HANDLE_VALUE || (flags & ~(CHANGEABLE|CHANGELESS))) @@ -3904,7 +3903,6 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode goto leave; #ifdef _WIN32 -#define MDB_NO_SUCH_FILE ERROR_FILE_NOT_FOUND if (F_ISSET(flags, MDB_RDONLY)) { oflags = GENERIC_READ; len = OPEN_EXISTING; @@ -3916,7 +3914,6 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode env->me_fd = CreateFile(dpath, oflags, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, len, mode, NULL); #else -#define MDB_NO_SUCH_FILE ENOENT if (F_ISSET(flags, MDB_RDONLY)) oflags = O_RDONLY; else @@ -3926,8 +3923,6 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode #endif if (env->me_fd == INVALID_HANDLE_VALUE) { rc = ErrCode(); - if (F_ISSET(flags, MDB_RDONLY) && rc == MDB_NO_SUCH_FILE) - rmlock = 1; goto leave; } @@ -3959,8 +3954,6 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode leave: if (rc) { mdb_env_close0(env, excl); - if (rmlock && excl) - unlink(lpath); } free(lpath); return rc;