From 38bbb0a8b85dfbb2e7460d0599a8694b5638e18c Mon Sep 17 00:00:00 2001 From: Francisco Souza Date: Sat, 18 May 2013 22:55:59 -0300 Subject: [PATCH] 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 --- components/engine/utils/uname_darwin.go | 7 +++++-- components/engine/utils/uname_linux.go | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/components/engine/utils/uname_darwin.go b/components/engine/utils/uname_darwin.go index d799554bbd..a875e8c600 100644 --- a/components/engine/utils/uname_darwin.go +++ b/components/engine/utils/uname_darwin.go @@ -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") } diff --git a/components/engine/utils/uname_linux.go b/components/engine/utils/uname_linux.go index 675a89b001..6e47bcc824 100644 --- a/components/engine/utils/uname_linux.go +++ b/components/engine/utils/uname_linux.go @@ -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 {