From 01b3c8f99bb346886a249aece465df4a4efacb69 Mon Sep 17 00:00:00 2001 From: jsteemann Date: Fri, 27 May 2016 14:08:14 +0200 Subject: [PATCH] fix lockfile handling --- lib/Basics/files.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Basics/files.cpp b/lib/Basics/files.cpp index db92063ca1..6c9aef0292 100644 --- a/lib/Basics/files.cpp +++ b/lib/Basics/files.cpp @@ -1261,7 +1261,7 @@ int TRI_VerifyLockFile(char const* filename) { // try to lock pid file int canLock = fcntl(fd, F_SETLK, &lock); // Exclusive (write) lock - // file was not yet locken; could be locked + // file was not yet locked; could be locked if (canLock == 0) { lock.l_type = F_UNLCK; fcntl(fd, F_GETLK, &lock); @@ -1332,14 +1332,14 @@ int TRI_DestroyLockFile(char const* filename) { lock.l_len = 0; lock.l_type = F_UNLCK; lock.l_whence = SEEK_SET; - // relesae the lock - int res = fcntl(fd, F_GETLK, &lock); + // release the lock + int res = fcntl(fd, F_SETLK, &lock); TRI_CLOSE(fd); if (res == 0) { TRI_UnlinkFile(filename); } - + // close lock file descriptor fd = *(int*)TRI_AtVector(&FileDescriptors, n); TRI_CLOSE(fd);