Browse code

make more pkgs support darwin

Signed-off-by: allencloud <allen.sun@daocloud.io>

allencloud authored on 2016/08/02 11:06:38
Showing 10 changed files
... ...
@@ -13,7 +13,7 @@ func Self() string {
13 13
 	return "/proc/self/exe"
14 14
 }
15 15
 
16
-// Command returns *exec.Cmd which have Path as current binary. Also it setting
16
+// Command returns *exec.Cmd which has Path as current binary. Also it setting
17 17
 // SysProcAttr.Pdeathsig to SIGTERM.
18 18
 // This will use the in-memory version (/proc/self/exe) of the current binary,
19 19
 // it is thus safe to delete or replace the on-disk binary (os.Args[0]).
... ...
@@ -1,4 +1,4 @@
1
-// +build freebsd solaris
1
+// +build freebsd solaris darwin
2 2
 
3 3
 package reexec
4 4
 
... ...
@@ -12,7 +12,7 @@ func Self() string {
12 12
 	return naiveSelf()
13 13
 }
14 14
 
15
-// Command returns *exec.Cmd which have Path as current binary.
15
+// Command returns *exec.Cmd which has Path as current binary.
16 16
 // For example if current binary is "docker" at "/usr/bin/", then cmd.Path will
17 17
 // be set to "/usr/bin/docker".
18 18
 func Command(args ...string) *exec.Cmd {
... ...
@@ -1,4 +1,4 @@
1
-// +build !linux,!windows,!freebsd,!solaris
1
+// +build !linux,!windows,!freebsd,!solaris,!darwin
2 2
 
3 3
 package reexec
4 4
 
... ...
@@ -6,7 +6,7 @@ import (
6 6
 	"os/exec"
7 7
 )
8 8
 
9
-// Command is unsupported on operating systems apart from Linux and Windows.
9
+// Command is unsupported on operating systems apart from Linux, Windows, Solaris and Darwin.
10 10
 func Command(args ...string) *exec.Cmd {
11 11
 	return nil
12 12
 }
... ...
@@ -12,7 +12,7 @@ func Self() string {
12 12
 	return naiveSelf()
13 13
 }
14 14
 
15
-// Command returns *exec.Cmd which have Path as current binary.
15
+// Command returns *exec.Cmd which has Path as current binary.
16 16
 // For example if current binary is "docker.exe" at "C:\", then cmd.Path will
17 17
 // be set to "C:\docker.exe".
18 18
 func Command(args ...string) *exec.Cmd {
19 19
deleted file mode 100644
... ...
@@ -1,7 +0,0 @@
1
-package sysinfo
2
-
3
-// New returns an empty SysInfo for freebsd for now.
4
-func New(quiet bool) *SysInfo {
5
-	sysInfo := &SysInfo{}
6
-	return sysInfo
7
-}
8 1
new file mode 100644
... ...
@@ -0,0 +1,9 @@
0
+// +build !linux,!solaris,!windows
1
+
2
+package sysinfo
3
+
4
+// New returns an empty SysInfo for non linux nor solaris for now.
5
+func New(quiet bool) *SysInfo {
6
+	sysInfo := &SysInfo{}
7
+	return sysInfo
8
+}
... ...
@@ -1,3 +1,5 @@
1
+// +build windows
2
+
1 3
 package sysinfo
2 4
 
3 5
 // New returns an empty SysInfo for windows for now.
4 6
deleted file mode 100644
... ...
@@ -1,8 +0,0 @@
1
-package system
2
-
3
-import "syscall"
4
-
5
-// LUtimesNano is not supported by darwin platform.
6
-func LUtimesNano(path string, ts []syscall.Timespec) error {
7
-	return ErrNotSupportedPlatform
8
-}
... ...
@@ -1,10 +1,10 @@
1
-// +build !linux,!freebsd,!darwin
1
+// +build !linux,!freebsd
2 2
 
3 3
 package system
4 4
 
5 5
 import "syscall"
6 6
 
7
-// LUtimesNano is not supported on platforms other than linux, freebsd and darwin.
7
+// LUtimesNano is only supported on linux and freebsd.
8 8
 func LUtimesNano(path string, ts []syscall.Timespec) error {
9 9
 	return ErrNotSupportedPlatform
10 10
 }
... ...
@@ -1,6 +1,6 @@
1 1
 // +build !windows
2 2
 
3
-// Package term provides provides structures and helper functions to work with
3
+// Package term provides structures and helper functions to work with
4 4
 // terminal (state, sizes).
5 5
 package term
6 6