From 993c705e2b5cd0715b12ca2a042474f4057f16ca Mon Sep 17 00:00:00 2001 From: SoftCoder Date: Wed, 6 Jan 2016 22:36:50 -0800 Subject: [PATCH] - attempt to fix issue #72 --- source/shared_lib/sources/util/util.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/shared_lib/sources/util/util.cpp b/source/shared_lib/sources/util/util.cpp index 2f383fe8..17de35c3 100644 --- a/source/shared_lib/sources/util/util.cpp +++ b/source/shared_lib/sources/util/util.cpp @@ -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);