From f454f6f46ece2966ecb0383e2ea4db04190a1516 Mon Sep 17 00:00:00 2001 From: Vladan Sekulic Date: Sat, 28 Mar 2026 18:47:37 +0100 Subject: [PATCH] fix: refactor file writing to use fs.writeFileSync --- bin/lib/onboard-session.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/lib/onboard-session.js b/bin/lib/onboard-session.js index 819790173..bbe095b43 100644 --- a/bin/lib/onboard-session.js +++ b/bin/lib/onboard-session.js @@ -227,9 +227,7 @@ function acquireOnboardLock(command = null) { for (let attempt = 0; attempt < 2; attempt++) { try { - const fd = fs.openSync(LOCK_FILE, "wx", 0o600); - fs.writeFileSync(fd, payload); - fs.closeSync(fd); + fs.writeFileSync(LOCK_FILE, payload, { flag: "wx", mode: 0o600 }); return { acquired: true, lockFile: LOCK_FILE, stale: false }; } catch (error) { if (error?.code !== "EEXIST") {