summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-06-19 21:28:07 +0000
committerZac Medico <zmedico@gentoo.org>2006-06-19 21:28:07 +0000
commit442b511530e65a45949dfc66236197116aa53850 (patch)
tree16ec8698161ea6fc693952cf7a431296aabcba7f
parent96a04fcef7c3ee2ac878cb3e8dfc7742383fde92 (diff)
downloadportage-442b511530e65a45949dfc66236197116aa53850.tar.gz
portage-442b511530e65a45949dfc66236197116aa53850.tar.bz2
portage-442b511530e65a45949dfc66236197116aa53850.zip
To prevent infinite recursion when a lock file has more than 1 hardlink, test for exactly 0 hardlinks before recursing.
svn path=/main/trunk/; revision=3540
-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 4c7da6d31..027399a02 100644
--- a/pym/portage_locks.py
+++ b/pym/portage_locks.py
@@ -121,7 +121,7 @@ def lockfile(mypath,wantnewlockfile=0,unlinkfile=0):
if type(lockfilename) == types.StringType and \
- myfd != HARDLINK_FD and os.fstat(myfd).st_nlink != 1:
+ myfd != HARDLINK_FD and os.fstat(myfd).st_nlink == 0:
# The file was deleted on us... Keep trying to make one...
os.close(myfd)
portage_util.writemsg("lockfile recurse\n",1)