aboutsummaryrefslogtreecommitdiffhomepage
path: root/main.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-02-15 14:40:19 +0900
committerOphestra <cat@gensokyo.uk>2025-02-15 14:40:19 +0900
commit3054527ca579c9063840c0eff1e6160d791254fe (patch)
tree407cbdabf6a56bb9d8901c9a456ab83fd929603a /main.go
parentddb2f9c11bcfabfef5f8f6d91eb19f6287ba1c92 (diff)
fortify: prevent exit status 0 on app failure
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/main.go b/main.go
index 59e55928..ea68dff6 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")
}