0
0
mirror of https://github.com/django/django.git synced 2024-12-01 15:42:04 +01:00

Fixed #8403 -- Changed the use of fcntl.flock() to fcntl.lockf(). On some

systems, this will ensure fnctl-based file locking is always used, which means
locking of NFS-mounted files should work.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8675 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2008-08-28 19:28:45 +00:00
parent f96b1249ce
commit 195420259a

View File

@ -54,10 +54,10 @@ if system_type == 'nt':
win32file.UnlockFileEx(hfile, 0, -0x10000, __overlapped)
elif system_type == 'posix':
def lock(file, flags):
fcntl.flock(fd(file), flags)
fcntl.lockf(fd(file), flags)
def unlock(file):
fcntl.flock(fd(file), fcntl.LOCK_UN)
fcntl.lockf(fd(file), fcntl.LOCK_UN)
else:
# File locking is not supported.
LOCK_EX = LOCK_SH = LOCK_NB = None