Skip to content

Commit

Permalink
Fix OSX build for sysinit
Browse files Browse the repository at this point in the history
  • Loading branch information
creack committed Dec 18, 2013
1 parent 70c7220 commit 73a1ef7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sysinit/sysinit.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func setupHostname(args *DockerInitArgs) error {
if hostname == "" {
return nil
}
return syscall.Sethostname([]byte(hostname))
return setHostname(hostname)
}

// Setup networking
Expand Down
5 changes: 5 additions & 0 deletions sysinit/sysinit_darwin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package sysinit

func setHostname(hostname string) error {
panic("Not supported on darwin")
}
9 changes: 9 additions & 0 deletions sysinit/sysinit_linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package sysinit

import (
"syscall"
)

func setHostname(hostname string) error {
return syscall.Sethostname([]byte(hostname))
}

0 comments on commit 73a1ef7

Please sign in to comment.