From 3054527ca579c9063840c0eff1e6160d791254fe Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sat, 15 Feb 2025 14:40:19 +0900 Subject: [PATCH] fortify: prevent exit status 0 on app failure Signed-off-by: Ophestra --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 59e5592..ea68dff 100644 --- a/main.go +++ b/main.go @@ -328,14 +328,14 @@ func runApp(config *fst.Config) { } else { logWaitError(err) } + + if rs.ExitCode == 0 { + rs.ExitCode = 126 + } } if rs.WaitErr != nil { fmsg.Println("inner wait failed:", rs.WaitErr) } - if rs.ExitCode < 0 { - fmsg.VPrintf("got negative exit %v", rs.ExitCode) - fmsg.Exit(1) - } fmsg.Exit(rs.ExitCode) panic("unreachable") }