Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
gyp: use fcntl.flock(fd, LOCK_EX)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tjfontaine committed Jan 26, 2014
1 parent 00efcb4 commit d0d4719
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/gyp/pylib/gyp/flock_tool.py
Expand Up @@ -40,8 +40,9 @@ def ExecFlock(self, lockfile, *cmd_list):
# 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)


Expand Down

0 comments on commit d0d4719

Please sign in to comment.