From da63ef8c75065cc36b62000aafdd9a325611043c Mon Sep 17 00:00:00 2001 From: Mark Asselstine Date: Fri, 11 Apr 2025 17:01:46 -0400 Subject: [PATCH] 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 Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- bitbake/lib/bb/utils.py | 1 + 1 file changed, 1 insertion(+) 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): # A version of lock_timeout without the check that the lock was locked and a shorter timeout @contextmanager def lock_timeout_nocheck(lock): + l = False try: s = signal.pthread_sigmask(signal.SIG_BLOCK, signal.valid_signals()) l = lock.acquire(timeout=10)