aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2023-05-31 14:42:46 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-06-01 08:08:13 +0100
commit5d499682a0a739b5269247a8f6dbb874e3eec456 (patch)
tree581eb1bf3e69cacd8ee9924445893bddd6472e4c
parent893f3b116b628457fe0bfaf4b8394b1cd05a90a5 (diff)
downloadbitbake-contrib-5d499682a0a739b5269247a8f6dbb874e3eec456.tar.gz
server: Fix crash when checking lock file
Fixes a crash when the server process attempts to check the PID of the lock file that resulted because an integer (os.getpid()) was attempting to be concatenated to a string Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/server/process.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index db417c842..7616ef53c 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -375,7 +375,7 @@ class ProcessServer():
lock = bb.utils.lockfile(lockfile, shared=False, retry=False, block=False)
if not lock:
newlockcontents = get_lock_contents(lockfile)
- if not newlockcontents[0].startswith([os.getpid() + "\n", os.getpid() + " "]):
+ if not newlockcontents[0].startswith([f"{os.getpid()}\n", f"{os.getpid()} "]):
# A new server was started, the lockfile contents changed, we can exit
serverlog("Lockfile now contains different contents, exiting: " + str(newlockcontents))
return