From 1d449e4d0c3ef961c97e4ec94e6a57be80894f94 Mon Sep 17 00:00:00 2001 From: sewn Date: Fri, 27 Sep 2024 11:59:08 +0300 Subject: [PATCH] cmd/vinegar: show signal on roblox process signaled --- cmd/vinegar/binary.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cmd/vinegar/binary.go b/cmd/vinegar/binary.go index 276ab11..9578078 100644 --- a/cmd/vinegar/binary.go +++ b/cmd/vinegar/binary.go @@ -301,13 +301,12 @@ func (b *Binary) Execute(args ...string) error { }() err = cmd.Run() - // thanks for your time, fizzie on #go-nuts - // ProcessState is non-nil if a process has been successfully started, - // check if it is non-nil and check if it was killed: - // ExitCode returns the exit code of the exited process, or -1 - // if the process hasn't exited or was terminated by a signal. + // Thanks for your time, fizzie on #go-nuts. + // Signal errors are not handled as errors since they are + // used internally to kill Roblox as well. if cmd.ProcessState != nil && cmd.ProcessState.ExitCode() == -1 { - slog.Warn("Roblox was killed!") + signal := cmd.ProcessState.Sys().(syscall.WaitStatus).Signal() + slog.Warn("Roblox was killed!", "signal", signal) return nil } return err