Skip to content

Commit

Permalink
cmd/vinegar: show signal on roblox process signaled
Browse files Browse the repository at this point in the history
  • Loading branch information
apprehensions committed Sep 27, 2024
1 parent 370cfde commit 1d449e4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions cmd/vinegar/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1d449e4

Please sign in to comment.