Browse code

Fix OSX build for sysinit

Guillaume J. Charmes authored on 2013/12/19 03:16:26
Showing 3 changed files
... ...
@@ -32,7 +32,7 @@ func setupHostname(args *DockerInitArgs) error {
32 32
 	if hostname == "" {
33 33
 		return nil
34 34
 	}
35
-	return syscall.Sethostname([]byte(hostname))
35
+	return setHostname(hostname)
36 36
 }
37 37
 
38 38
 // Setup networking
39 39
new file mode 100644
... ...
@@ -0,0 +1,5 @@
0
+package sysinit
1
+
2
+func setHostname(hostname string) error {
3
+	panic("Not supported on darwin")
4
+}
0 5
new file mode 100644
... ...
@@ -0,0 +1,9 @@
0
+package sysinit
1
+
2
+import (
3
+	"syscall"
4
+)
5
+
6
+func setHostname(hostname string) error {
7
+	return syscall.Sethostname([]byte(hostname))
8
+}