summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-09-14 07:44:54 +0000
committerZac Medico <zmedico@gentoo.org>2006-09-14 07:44:54 +0000
commit6acf6754e6c512119f236efedf21e1233b75be7c (patch)
treea2332a0635f29a4d1013dd5e8a6e2fbbb0bcf94f
parent01dd334a273b7b456b3223239ac86dacf4c1bd7c (diff)
downloadportage-6acf6754e6c512119f236efedf21e1233b75be7c.tar.gz
portage-6acf6754e6c512119f236efedf21e1233b75be7c.tar.bz2
portage-6acf6754e6c512119f236efedf21e1233b75be7c.zip
Simplify portage_locks.hardlink_is_mine() so that it only checks the number of links. Nothing more is needed.
svn path=/main/trunk/; revision=4448
-rw-r--r--pym/portage_locks.py14
1 files changed, 2 insertions, 12 deletions
diff --git a/pym/portage_locks.py b/pym/portage_locks.py
index 98ccab8ae..77169906c 100644
--- a/pym/portage_locks.py
+++ b/pym/portage_locks.py
@@ -193,19 +193,9 @@ def hardlink_active(lock):
def hardlink_is_mine(link,lock):
try:
- myhls = os.stat(link)
- mylfs = os.stat(lock)
+ return os.stat(link).st_nlink == 2
except OSError:
- myhls = None
- mylfs = None
-
- if myhls:
- if myhls[stat.ST_NLINK] == 2:
- return True
- if mylfs:
- if mylfs[stat.ST_INO] == myhls[stat.ST_INO]:
- return True
- return False
+ return False
def hardlink_lockfile(lockfilename, max_wait=14400):
"""Does the NFS, hardlink shuffle to ensure locking on the disk.