Skip to content

Commit

Permalink
Add docstring to reexec.Command
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Morozov <[email protected]>
  • Loading branch information
LK4D4 committed Jul 21, 2015
1 parent 77bbee3 commit 9738b93
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/reexec/command_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
"syscall"
)

// Command returns *exec.Cmd which have Path as current binary. Also it setting
// SysProcAttr.Pdeathsig to SIGTERM.
// For example if current binary is "docker" at "/usr/bin", then cmd.Path will
// be set to "/usr/bin/docker".
func Command(args ...string) *exec.Cmd {
return &exec.Cmd{
Path: Self(),
Expand Down
1 change: 1 addition & 0 deletions pkg/reexec/command_unsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os/exec"
)

// Command is unsupported on operating systems apart from Linux and Windows.
func Command(args ...string) *exec.Cmd {
return nil
}
3 changes: 3 additions & 0 deletions pkg/reexec/command_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import (
"os/exec"
)

// Command returns *exec.Cmd which have Path as current binary.
// For example if current binary is "docker.exe" at "C:\", then cmd.Path will
// be set to "C:\docker.exe".
func Command(args ...string) *exec.Cmd {
return &exec.Cmd{
Path: Self(),
Expand Down

0 comments on commit 9738b93

Please sign in to comment.