diff mbox series

[1/6] server/process: Fix lockfile contents check bug

Message ID 20230121212305.2171310-1-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit 4abc598fb01d426394f4222dfc752e620a8e1b7b
Headers show
Series [1/6] server/process: Fix lockfile contents check bug | expand

Commit Message

Richard Purdie Jan. 21, 2023, 9:23 p.m. UTC
We need to check against the first line of the file, fix the typo.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/server/process.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index 4bd68b1e7f..01ce916a3d 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -376,7 +376,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.startswith([os.getpid() + "\n", os.getpid() + " "]):
+                    if not newlockcontents[0].startswith([os.getpid() + "\n", os.getpid() + " "]):
                         # A new server was started, the lockfile contents changed, we can exit
                         serverlog("Lockfile now contains different contents, exiting: " + str(newlockcontents))
                         return