wutingcindy / gyp

Automatically exported from code.google.com/p/gyp
0 stars 0 forks source link

AIX struct flock incorrect layout #440

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Patch for flock_tool.py submitted but no response. Repeated below:

Index: pylib/gyp/flock_tool.py
===================================================================
--- pylib/gyp/flock_tool.py     (revision 1948)
+++ pylib/gyp/flock_tool.py     (working copy)
@@ -40,7 +40,10 @@
     # 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)
+    if sys.platform.startswith('aix'):
+      op = struct.pack('hhqqIll', fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0)
+    else:
+      op = struct.pack('hhllhhl', fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0)
     fcntl.fcntl(fd, fcntl.F_SETLK, op)
     return subprocess.call(cmd_list)

Original issue reported on code.google.com by dje....@gmail.com on 10 Jul 2014 at 5:57