Staging
v0.5.1
Revision 82735da0165cc8b0b080d7e28d4123c3168c4cf7 authored by Thomas Wouters on 07 March 2006, 14:16:02 UTC, committed by Thomas Wouters on 07 March 2006, 14:16:02 UTC
Coverity found bug: test result of PyTuple_New() against NULL before use.

and r42891 (thomas.wouters):

Fix gcc 4.0.x warning about use of uninitialized value.
1 parent d704935
Raw File
lockfile.py
import struct, fcntl

def writelock(f):
    _lock(f, fcntl.F_WRLCK)

def readlock(f):
    _lock(f, fcntl.F_RDLCK)

def unlock(f):
    _lock(f, fcntl.F_UNLCK)

def _lock(f, op):
    dummy = fcntl.fcntl(f.fileno(), fcntl.F_SETLKW,
                        struct.pack('2h8l', op,
                                    0, 0, 0, 0, 0, 0, 0, 0, 0))
back to top