summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/dbapi/vartree.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index d438cbee0..3c7e646eb 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -1211,6 +1211,10 @@ class dblink(object):
writemsg_stdout("--- !md5 %s %s\n" % ("obj", obj))
continue
try:
+ if statobj.st_nlink > 1:
+ portage.writemsg("There are "+str(st.st_nlink-1)+" hardlinks to " + obj)
+ # Always blind chmod 0 before unlinking to avoid race conditions.
+ os.chmod(obj, 0000)
os.unlink(obj)
except (OSError, IOError), e:
pass