diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-01-19 13:30:14 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-01-19 13:30:14 +0000 |
commit | fd88588df029604689db9b0e30c55aad68392a5d (patch) | |
tree | 8a43cbb3835849397b35d295b5299142291ced6e /bitbake | |
parent | 542cebbc3282a0b3acb68a5ef0d8c2a61b0ecc38 (diff) | |
download | poky-fd88588df029604689db9b0e30c55aad68392a5d.tar.gz |
bitbake/utils.py: Teach unlockfile about shared mode lockfiles
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/utils.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 5dc7e766f5..c6bbae87a4 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -445,7 +445,13 @@ def unlockfile(lf): | |||
445 | """ | 445 | """ |
446 | Unlock a file locked using lockfile() | 446 | Unlock a file locked using lockfile() |
447 | """ | 447 | """ |
448 | os.unlink(lf.name) | 448 | try: |
449 | # If we had a shared lock, we need to promote to exclusive before | ||
450 | # removing the lockfile. Attempt this, ignore failures. | ||
451 | fcntl.flock(lf.fileno(), fcntl.LOCK_EX|fcntl.LOCK_NB) | ||
452 | os.unlink(lf.name) | ||
453 | except IOError: | ||
454 | pass | ||
449 | fcntl.flock(lf.fileno(), fcntl.LOCK_UN) | 455 | fcntl.flock(lf.fileno(), fcntl.LOCK_UN) |
450 | lf.close() | 456 | lf.close() |
451 | 457 | ||