- attempt to fix issue #72

This commit is contained in:
SoftCoder 2016-01-06 22:36:50 -08:00
parent 3edbff630d
commit 993c705e2b
1 changed files with 3 additions and 0 deletions

View File

@ -287,10 +287,13 @@ inline bool acquire_file_lock(int hnd)
{
#ifndef WIN32
struct ::flock lock;
// Initialize the flock structure.
memset(&lock, 0, sizeof(lock));
lock.l_type = F_WRLCK;
lock.l_whence = SEEK_SET;
lock.l_start = 0;
lock.l_len = 0;
lock.l_pid = 0;
return -1 != ::fcntl(hnd, F_SETLK, &lock);
#else
HANDLE hFile = (HANDLE)_get_osfhandle(hnd);