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.
Upstream-commit: 2b55874584f034b5113359ced6b05c143d31e03c
Component: engine
This commit is contained in:
Francisco Souza
2013-05-19 00:02:42 -03:00
parent 8b5995d5c6
commit 38bbb0a8b8
2 changed files with 8 additions and 4 deletions
+5 -2
View File
@@ -2,9 +2,12 @@ package utils
import (
"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")
}
+3 -2
View File
@@ -4,8 +4,9 @@ import (
"syscall"
)
// FIXME: Move this to utils package
func uname() (*syscall.Utsname, error) {
type Utsname syscall.Utsname
func uname() (*Utsname, error) {
uts := &syscall.Utsname{}
if err := syscall.Uname(uts); err != nil {