Skip to content
Permalink
Browse files

FS

- Corrected initialization order of struct flock for DARWIN. This may address
  file locking prboelms on MacOS.
  • Loading branch information...
pbeckingham committed Mar 2, 2019
1 parent ba9b76d commit 4c0d722188a5362695064e443df505d23c524170
Showing with 10 additions and 2 deletions.
  1. +2 −0 ChangeLog
  2. +8 −2 src/FS.cpp
@@ -11,6 +11,8 @@ master/HEAD
- LI #5 Several Path:: methods fail on a broken symlink
- LI #7 Path::expand() doesn't correctly expand some paths
(thanks to Laurence)
- Corrected initialization order of struct flock for DARWIN. This may address
file locking prboelms on MacOS.

tasksh-1.2.0 (2017-05-10)

@@ -469,7 +469,10 @@ bool File::lock ()
_locked = false;
if (_fh && _h != -1)
{
#ifdef FREEBSD
#ifdef DARWIN
// l_start l_len l_pid l_type l_whence
struct flock fl = {0, 0, 0, F_WRLCK, SEEK_SET};
#elif FREEBSD
// l_type l_whence l_start l_len l_pid l_sysid
struct flock fl = {F_WRLCK, SEEK_SET, 0, 0, 0, 0 };
#else
@@ -489,7 +492,10 @@ void File::unlock ()
{
if (_locked)
{
#ifdef FREEBSD
#ifdef DARWIN
// l_start l_len l_pid l_type l_whence
struct flock fl = {0, 0, 0, F_WRLCK, SEEK_SET};
#elif FREEBSD
// l_type l_whence l_start l_len l_pid l_sysid
struct flock fl = {F_WRLCK, SEEK_SET, 0, 0, 0, 0 };
#else

0 comments on commit 4c0d722

Please sign in to comment.
You can’t perform that action at this time.