Fix OSX compilation for aufs

This commit is contained in:
Guillaume J. Charmes 2013-12-18 10:18:49 -08:00
parent 73a1ef7c22
commit e481c82fa9
3 changed files with 5 additions and 2 deletions

View File

@ -30,7 +30,6 @@ import (
"os/exec" "os/exec"
"path" "path"
"strings" "strings"
"syscall"
) )
func init() { func init() {
@ -327,7 +326,7 @@ func (a *Driver) aufsMount(ro []string, rw, target string) (err error) {
for _, layer := range ro { for _, layer := range ro {
branch := fmt.Sprintf("append:%s=ro+wh", layer) 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 return
} }
} }

View File

@ -2,6 +2,8 @@ package aufs
import "errors" import "errors"
const MsRemount = 0
func mount(source string, target string, fstype string, flags uintptr, data string) (err error) { func mount(source string, target string, fstype string, flags uintptr, data string) (err error) {
return errors.New("mount is not implemented on darwin") return errors.New("mount is not implemented on darwin")
} }

View File

@ -2,6 +2,8 @@ package aufs
import "syscall" import "syscall"
const MsRemount = syscall.MS_REMOUNT
func mount(source string, target string, fstype string, flags uintptr, data string) error { func mount(source string, target string, fstype string, flags uintptr, data string) error {
return syscall.Mount(source, target, fstype, flags, data) return syscall.Mount(source, target, fstype, flags, data)
} }