Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions execshim/cmd.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package execshim

import (
"code.cloudfoundry.org/goshims/osshim"
"io"
"syscall"
)
Expand All @@ -20,4 +21,5 @@ type Cmd interface {
CombinedOutput() ([]byte, error)
Pid() int
SysProcAttr() *syscall.SysProcAttr
Process() osshim.Process
}
8 changes: 8 additions & 0 deletions execshim/cmdshim.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package execshim

import (
"code.cloudfoundry.org/goshims/osshim"
"io"
"os/exec"
"syscall"
Expand Down Expand Up @@ -57,3 +58,10 @@ func (c *cmdShim) SetStdin(b io.Reader) {
func (c *cmdShim) SetEnv(rhs []string) {
c.Cmd.Env = rhs
}

func (c *cmdShim) Process() osshim.Process {
if c.Cmd.Process == nil {
return nil
}
return &osshim.ProcessShim{Process: c.Cmd.Process}
}
66 changes: 66 additions & 0 deletions execshim/exec_fake/fake_cmd.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

112 changes: 112 additions & 0 deletions osshim/os_fake/fake_process.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions osshim/process.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package osshim

import "os"

//go:generate counterfeiter -o os_fake/fake_process.go . Process
type Process interface {
Signal(sig os.Signal) error
}
11 changes: 11 additions & 0 deletions osshim/process_shim.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package osshim

import "os"

type ProcessShim struct {
*os.Process
}

func (p *ProcessShim) Signal(sig os.Signal) error {
return p.Signal(sig)
}