From: Zac Medico Date: Tue, 14 Feb 2006 22:38:27 +0000 (-0000) Subject: fix race condition for bug 121819 by using os.fstat(myfd).st_nlink instead of os... X-Git-Tag: v2.1_pre5_2760~44 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0366fcd8bc46a9560f76ca467a1f9edddf0696d3;p=portage.git fix race condition for bug 121819 by using os.fstat(myfd).st_nlink instead of os.path.exists svn path=/main/trunk/; revision=2712 --- diff --git a/pym/portage_locks.py b/pym/portage_locks.py index 09daa2e4d..a6e1afe57 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)