To prevent infinite recursion when a lock file has more than 1 hardlink, test for...
authorZac Medico <zmedico@gentoo.org>
Wed, 21 Jun 2006 02:42:00 +0000 (02:42 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 21 Jun 2006 02:42:00 +0000 (02:42 -0000)
svn path=/main/branches/2.1/; revision=3568

pym/portage.py
pym/portage_locks.py

index 61fb472c8b29b58f8dd3bab8f2165c2b81fbb41e..042656dd6b3f393379d36fcc1e9ec233c9bef825 100644 (file)
@@ -6366,7 +6366,8 @@ class dblink:
                        os.chown(my_private_path, os.getuid(), portage_gid)
                        os.chmod(my_private_path, 02770)
 
-               mylock = portage_locks.lockfile(os.path.join(destroot, CONFIG_MEMORY_FILE))
+               mylock = portage_locks.lockfile(
+                       os.path.join(destroot, CONFIG_MEMORY_FILE), wantnewlockfile=1)
                writedict(cfgfiledict, os.path.join(destroot, CONFIG_MEMORY_FILE))
                portage_locks.unlockfile(mylock)
 
index 30946c43778d8e036c76f8bd29ac90b26521b5b8..b474cc4915f791065de8eaa2b2d98a52b451d3b3 100644 (file)
@@ -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)