- attempt to fix issue #72
This commit is contained in:
parent
3edbff630d
commit
993c705e2b
|
@ -287,10 +287,13 @@ inline bool acquire_file_lock(int hnd)
|
||||||
{
|
{
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
struct ::flock lock;
|
struct ::flock lock;
|
||||||
|
// Initialize the flock structure.
|
||||||
|
memset(&lock, 0, sizeof(lock));
|
||||||
lock.l_type = F_WRLCK;
|
lock.l_type = F_WRLCK;
|
||||||
lock.l_whence = SEEK_SET;
|
lock.l_whence = SEEK_SET;
|
||||||
lock.l_start = 0;
|
lock.l_start = 0;
|
||||||
lock.l_len = 0;
|
lock.l_len = 0;
|
||||||
|
lock.l_pid = 0;
|
||||||
return -1 != ::fcntl(hnd, F_SETLK, &lock);
|
return -1 != ::fcntl(hnd, F_SETLK, &lock);
|
||||||
#else
|
#else
|
||||||
HANDLE hFile = (HANDLE)_get_osfhandle(hnd);
|
HANDLE hFile = (HANDLE)_get_osfhandle(hnd);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user