From bfc23cdfa168f155a3cf265e67d1d4810b05ef78 Mon Sep 17 00:00:00 2001 From: Scott Date: Sun, 18 Jan 2026 13:12:11 -0700 Subject: [PATCH] fix: guard signal forwarding against race conditions --- start-automaker.mjs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/start-automaker.mjs b/start-automaker.mjs index 79ace0dd..04569819 100644 --- a/start-automaker.mjs +++ b/start-automaker.mjs @@ -119,9 +119,13 @@ function runBashScript() { process.exit(code ?? 0); }); - // Forward signals to child process - process.on('SIGINT', () => child.kill('SIGINT')); - process.on('SIGTERM', () => child.kill('SIGTERM')); + // Forward signals to child process (guard against race conditions) + process.on('SIGINT', () => { + if (!child.killed) child.kill('SIGINT'); + }); + process.on('SIGTERM', () => { + if (!child.killed) child.kill('SIGTERM'); + }); } runBashScript();