Fix 'Bad file descriptor' error with hardlink locking for bug 124140.
authorZac Medico <zmedico@gentoo.org>
Sun, 26 Feb 2006 12:05:36 +0000 (12:05 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 26 Feb 2006 12:05:36 +0000 (12:05 -0000)
svn path=/main/trunk/; revision=2790

pym/portage_locks.py

index f108cba2eccee57fcfbc1e031991a39f32161981..9f4bdaa342e1f4134e51edb5c1785e6c7191a8c7 100644 (file)
@@ -122,7 +122,8 @@ def lockfile(mypath,wantnewlockfile=0,unlinkfile=0):
                        raise
 
                
-       if type(lockfilename) == types.StringType and os.fstat(myfd).st_nlink != 1:
+       if type(lockfilename) == types.StringType and \
+               myfd != HARDLINK_FD 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)