Skip to content

Commit

Permalink
Merge branch 'main' into becca/rungroup-shutdown-timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany authored Dec 1, 2023
2 parents e9d6928 + bd3911b commit 83bada1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/osquery/runtime/runtime_helpers_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ func setpgid() *syscall.SysProcAttr {
return &syscall.SysProcAttr{}
}

func killProcessGroup(cmd *exec.Cmd) error {
func killProcessGroup(origCmd *exec.Cmd) error {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()

// some discussion here https://github.com/golang/dep/pull/857
cmd, err := allowedcmd.Taskkill(ctx, "/F", "/T", "/PID", fmt.Sprint(cmd.Process.Pid))
cmd, err := allowedcmd.Taskkill(ctx, "/F", "/T", "/PID", fmt.Sprint(origCmd.Process.Pid))
if err != nil {
return fmt.Errorf("creating command: %w", err)
}
Expand Down

0 comments on commit 83bada1

Please sign in to comment.