mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #3264 from creack/fix_osx_compilation
Fix osx compilation
This commit is contained in:
commit
553b4dae45
6 changed files with 20 additions and 3 deletions
|
@ -30,7 +30,6 @@ import (
|
|||
"os/exec"
|
||||
"path"
|
||||
"strings"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -327,7 +326,7 @@ func (a *Driver) aufsMount(ro []string, rw, target string) (err error) {
|
|||
|
||||
for _, layer := range ro {
|
||||
branch := fmt.Sprintf("append:%s=ro+wh", layer)
|
||||
if err = mount("none", target, "aufs", syscall.MS_REMOUNT, branch); err != nil {
|
||||
if err = mount("none", target, "aufs", MsRemount, branch); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@ package aufs
|
|||
|
||||
import "errors"
|
||||
|
||||
const MsRemount = 0
|
||||
|
||||
func mount(source string, target string, fstype string, flags uintptr, data string) (err error) {
|
||||
return errors.New("mount is not implemented on darwin")
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@ package aufs
|
|||
|
||||
import "syscall"
|
||||
|
||||
const MsRemount = syscall.MS_REMOUNT
|
||||
|
||||
func mount(source string, target string, fstype string, flags uintptr, data string) error {
|
||||
return syscall.Mount(source, target, fstype, flags, data)
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ func setupHostname(args *DockerInitArgs) error {
|
|||
if hostname == "" {
|
||||
return nil
|
||||
}
|
||||
return syscall.Sethostname([]byte(hostname))
|
||||
return setHostname(hostname)
|
||||
}
|
||||
|
||||
// Setup networking
|
||||
|
|
5
sysinit/sysinit_darwin.go
Normal file
5
sysinit/sysinit_darwin.go
Normal file
|
@ -0,0 +1,5 @@
|
|||
package sysinit
|
||||
|
||||
func setHostname(hostname string) error {
|
||||
panic("Not supported on darwin")
|
||||
}
|
9
sysinit/sysinit_linux.go
Normal file
9
sysinit/sysinit_linux.go
Normal file
|
@ -0,0 +1,9 @@
|
|||
package sysinit
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func setHostname(hostname string) error {
|
||||
return syscall.Sethostname([]byte(hostname))
|
||||
}
|
Loading…
Reference in a new issue