From 9738b9319b7a5133653c4912db8ec361af5847fc Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Mon, 20 Jul 2015 10:16:37 -0700 Subject: [PATCH] Add docstring to reexec.Command Signed-off-by: Alexander Morozov --- pkg/reexec/command_linux.go | 4 ++++ pkg/reexec/command_unsupported.go | 1 + pkg/reexec/command_windows.go | 3 +++ 3 files changed, 8 insertions(+) diff --git a/pkg/reexec/command_linux.go b/pkg/reexec/command_linux.go index 8dc3f3a4a6..e22a0232dc 100644 --- a/pkg/reexec/command_linux.go +++ b/pkg/reexec/command_linux.go @@ -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(), diff --git a/pkg/reexec/command_unsupported.go b/pkg/reexec/command_unsupported.go index 4adcd8f13e..630eecbd96 100644 --- a/pkg/reexec/command_unsupported.go +++ b/pkg/reexec/command_unsupported.go @@ -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 } diff --git a/pkg/reexec/command_windows.go b/pkg/reexec/command_windows.go index 124d42fc62..a2a7aa9617 100644 --- a/pkg/reexec/command_windows.go +++ b/pkg/reexec/command_windows.go @@ -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(),