summaryrefslogtreecommitdiff
path: root/django/core/files/locks.py
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-08-28 19:28:45 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-08-28 19:28:45 +0000
commit195420259a5286cbeface8ef7d0570e5e8d651e0 (patch)
tree39a6f85139112280720846bf7216dfa732824564 /django/core/files/locks.py
parentf96b1249cedc2c2b5303b626ea33911e6bbc6d7b (diff)
downloaddjango-195420259a5286cbeface8ef7d0570e5e8d651e0.tar.gz
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
Diffstat (limited to 'django/core/files/locks.py')
-rw-r--r--django/core/files/locks.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/core/files/locks.py b/django/core/files/locks.py
index 98a11551a7..7f187efed4 100644
--- a/django/core/files/locks.py
+++ b/django/core/files/locks.py
@@ -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