Skip to content

Commit

Permalink
Removed call to Setpgid in the process gear.
Browse files Browse the repository at this point in the history
  • Loading branch information
keithpitt committed Oct 15, 2015
1 parent 362b42f commit 45d5e81
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 14 deletions.
3 changes: 0 additions & 3 deletions process/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ func (p Process) Create() *Process {
p.command = exec.Command(absolutePath)
p.command.Dir = scriptDirectory

// Do cross-platform things to prepare this process to run
PrepareCommandProcess(&p)

// Copy the current processes ENV and merge in the new ones. We do this
// so the sub process gets PATH and stuff. We merge our path in over
// the top of the current one so the ENV from Buildkite and the agent
Expand Down
7 changes: 0 additions & 7 deletions process/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,10 @@ package process
import (
"os"
"os/exec"
"syscall"

"github.com/kr/pty"
)

func StartPTY(c *exec.Cmd) (*os.File, error) {
return pty.Start(c)
}

func PrepareCommandProcess(p *Process) {
// Children of the forked process will inherit its process group
// This is to make sure that all grandchildren dies when this Process instance is killed
p.command.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
}
4 changes: 0 additions & 4 deletions process/utils_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,3 @@ import (
func StartPTY(c *exec.Cmd) (*os.File, error) {
return nil, errors.New("PTY is not supported on Windows")
}

func PrepareCommandProcess(p *Process) {
// Nothing to prepare!
}

0 comments on commit 45d5e81

Please sign in to comment.