Browse Source

utils: fix compilation on Darwin

Although Docker daemon does not work on Darwin, the API client will have
to work. That said, I'm fixing the compilation of the package on Darwin.
Francisco Souza 12 years ago
parent
commit
2b55874584
2 changed files with 8 additions and 4 deletions
  1. 5 2
      utils/uname_darwin.go
  2. 3 2
      utils/uname_linux.go

+ 5 - 2
utils/uname_darwin.go

@@ -2,9 +2,12 @@ package utils
 
 
 import (
 import (
 	"errors"
 	"errors"
-	"syscall"
 )
 )
 
 
-func uname() (*syscall.Utsname, error) {
+type Utsname struct {
+	Release [65]byte
+}
+
+func uname() (*Utsname, error) {
 	return nil, errors.New("Kernel version detection is not available on darwin")
 	return nil, errors.New("Kernel version detection is not available on darwin")
 }
 }

+ 3 - 2
utils/uname_linux.go

@@ -4,8 +4,9 @@ import (
 	"syscall"
 	"syscall"
 )
 )
 
 
-// FIXME: Move this to utils package
-func uname() (*syscall.Utsname, error) {
+type Utsname syscall.Utsname
+
+func uname() (*Utsname, error) {
 	uts := &syscall.Utsname{}
 	uts := &syscall.Utsname{}
 
 
 	if err := syscall.Uname(uts); err != nil {
 	if err := syscall.Uname(uts); err != nil {