hardlink_lockfile: optimize away most link calls
authorZac Medico <zmedico@gentoo.org>
Wed, 14 Dec 2011 05:59:59 +0000 (21:59 -0800)
committerZac Medico <zmedico@gentoo.org>
Wed, 14 Dec 2011 05:59:59 +0000 (21:59 -0800)
commit3bcbe6b069687855fa3cc8f0e39be6c240ee3e3e
tree7fcbb9983aea62dbb96d8a9a296e141fc0339abe
parent7bcb8e14d52c51904d42ccb1df49f481df2be9dd
hardlink_lockfile: optimize away most link calls

If fstat shows more than one hardlink, then it's extremely unlikely
that the following link call will result in a lock, so optimize away
the wasteful link call and sleep or raise TryAgain.
pym/portage/locks.py