[utils] Use flock instead of lockf (Fixes #3621)
authorPhilipp Hagemeister <phihag@phihag.de>
Sun, 31 Aug 2014 23:41:25 +0000 (01:41 +0200)
committerPhilipp Hagemeister <phihag@phihag.de>
Sun, 31 Aug 2014 23:41:25 +0000 (01:41 +0200)
youtube_dl/utils.py

index 8a36e619ae7246da1f18a4d5fd6cee7b364b81b7..6fe05723484303839947357124fc9d9ebfadcf4e 100644 (file)
@@ -1141,10 +1141,10 @@ else:
     import fcntl
 
     def _lock_file(f, exclusive):
-        fcntl.lockf(f, fcntl.LOCK_EX if exclusive else fcntl.LOCK_SH)
+        fcntl.flock(f, fcntl.LOCK_EX if exclusive else fcntl.LOCK_SH)
 
     def _unlock_file(f):
-        fcntl.lockf(f, fcntl.LOCK_UN)
+        fcntl.flock(f, fcntl.LOCK_UN)
 
 
 class locked_file(object):