summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-02-14 22:38:27 +0000
committerZac Medico <zmedico@gentoo.org>2006-02-14 22:38:27 +0000
commit0366fcd8bc46a9560f76ca467a1f9edddf0696d3 (patch)
tree6b6d30070ef96dd49103848bd9ee86abdae3b247 /pym/portage_locks.py
parentget rid of pointless whitespace (diff)
downloadportage-multirepo-0366fcd8bc46a9560f76ca467a1f9edddf0696d3.tar.gz
portage-multirepo-0366fcd8bc46a9560f76ca467a1f9edddf0696d3.tar.bz2
portage-multirepo-0366fcd8bc46a9560f76ca467a1f9edddf0696d3.zip
fix race condition for bug 121819 by using os.fstat(myfd).st_nlink instead of os.path.exists
svn path=/main/trunk/; revision=2712
Diffstat (limited to 'pym/portage_locks.py')
-rw-r--r--pym/portage_locks.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pym/portage_locks.py b/pym/portage_locks.py
index 09daa2e4..a6e1afe5 100644
--- a/pym/portage_locks.py
+++ b/pym/portage_locks.py
@@ -122,7 +122,7 @@ def lockfile(mypath,wantnewlockfile=0,unlinkfile=0):
raise
- if type(lockfilename) == types.StringType and not os.path.exists(lockfilename):
+ if type(lockfilename) == types.StringType and os.fstat(myfd).st_nlink != 1:
# The file was deleted on us... Keep trying to make one...
os.close(myfd)
portage_util.writemsg("lockfile recurse\n",1)