summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-09-18 04:12:34 -0700
committerZac Medico <zmedico@gentoo.org>2010-09-18 04:12:34 -0700
commit056bcf353615186e755122b6bf2f0ffe98a9c6c7 (patch)
tree59fc2509d49d6d15a5d04a2a95702b3ec636d1ff
parentc86d7614083539325184dd70828cdbad39525d8c (diff)
downloadportage-056bcf353615186e755122b6bf2f0ffe98a9c6c7.tar.gz
portage-056bcf353615186e755122b6bf2f0ffe98a9c6c7.tar.bz2
portage-056bcf353615186e755122b6bf2f0ffe98a9c6c7.zip
Fix lockfile() to close the file descriptor before raising TryAgain.
-rw-r--r--pym/portage/locks.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/pym/portage/locks.py b/pym/portage/locks.py
index 00a50b818..1f8f58013 100644
--- a/pym/portage/locks.py
+++ b/pym/portage/locks.py
@@ -118,6 +118,7 @@ def lockfile(mypath, wantnewlockfile=0, unlinkfile=0,
if e.errno in (errno.EACCES, errno.EAGAIN):
# resource temp unavailable; eg, someone beat us to the lock.
if flags & os.O_NONBLOCK:
+ os.close(myfd)
raise TryAgain(mypath)
global _quiet