diff options
author | Mark Asselstine <mark.asselstine@windriver.com> | 2025-04-11 17:01:46 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-04-24 11:53:00 +0100 |
commit | da63ef8c75065cc36b62000aafdd9a325611043c (patch) | |
tree | 42bbdde6fede2f2817e72a6cebf3bc2c3d387cf4 /bitbake/lib/bb | |
parent | a3a10a15c4bfaa1faa77c1895e22ec4a1e1fa456 (diff) | |
download | poky-da63ef8c75065cc36b62000aafdd9a325611043c.tar.gz |
bitbake: utils: lock_timeout_nocheck() ensure `l` is initialized
lock_timeout_nocheck() can be interrupted immediately after enterring
the try-block and prior to initializing 'l', for example with a
ctrl-C, the code in finally will still be run and the 'if l' will
fail. Initialize 'l' as False to avoid this possiblity.
(Bitbake rev: 4885cd9d275ba2ab60e5c76aed856c34533cd3ae)
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/utils.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 5486f9599d..a1e093925b 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -1898,6 +1898,7 @@ def lock_timeout(lock): | |||
1898 | # A version of lock_timeout without the check that the lock was locked and a shorter timeout | 1898 | # A version of lock_timeout without the check that the lock was locked and a shorter timeout |
1899 | @contextmanager | 1899 | @contextmanager |
1900 | def lock_timeout_nocheck(lock): | 1900 | def lock_timeout_nocheck(lock): |
1901 | l = False | ||
1901 | try: | 1902 | try: |
1902 | s = signal.pthread_sigmask(signal.SIG_BLOCK, signal.valid_signals()) | 1903 | s = signal.pthread_sigmask(signal.SIG_BLOCK, signal.valid_signals()) |
1903 | l = lock.acquire(timeout=10) | 1904 | l = lock.acquire(timeout=10) |