diff options
author | Timothy J Fontaine <tjfontaine@gmail.com> | 2014-01-26 09:28:49 -0800 |
---|---|---|
committer | Timothy J Fontaine <tjfontaine@gmail.com> | 2014-01-26 09:28:49 -0800 |
commit | d0d4719e4727bba59cd4e5108f6a674c9ba2c12e (patch) | |
tree | 9e7f9fb14fe786861c4812689fe571e51f89f9c7 | |
parent | 00efcb4cd7609dcefad8acba915d850480436457 (diff) | |
download | node-gyp-flock.tar.gz |
gyp: use fcntl.flock(fd, LOCK_EX)gyp-flock
It was changed to work around an old python and sunos bug, which
appears to have been solved now, maybe we can avoid the racey builds
now.
-rwxr-xr-x | tools/gyp/pylib/gyp/flock_tool.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/gyp/pylib/gyp/flock_tool.py b/tools/gyp/pylib/gyp/flock_tool.py index 3e7efff26..df8dfbfdd 100755 --- a/tools/gyp/pylib/gyp/flock_tool.py +++ b/tools/gyp/pylib/gyp/flock_tool.py @@ -40,8 +40,9 @@ class FlockTool(object): # with EBADF, that's why we use this F_SETLK # hack instead. fd = os.open(lockfile, os.O_WRONLY|os.O_NOCTTY|os.O_CREAT, 0666) - op = struct.pack('hhllhhl', fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) - fcntl.fcntl(fd, fcntl.F_SETLK, op) + #op = struct.pack('hhllhhl', fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) + #fcntl.fcntl(fd, fcntl.F_SETLK, op) + fcntl.flock(fd, fcntl.LOCK_EX) return subprocess.call(cmd_list) |