浏览代码

Remove all darwin specific files and use more generic _unsupported with build tags.
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)

Guillaume J. Charmes 11 年之前
父节点
当前提交
45dd051e8e

+ 1 - 0
archive/stat_darwin.go → archive/stat_unsupported.go

@@ -1,3 +1,4 @@
+// +build: !linux !amd64
 package archive
 
 import "syscall"

+ 1 - 0
execdriver/lxc/lxc_init_darwin.go → execdriver/lxc/lxc_init_unsupported.go

@@ -1,3 +1,4 @@
+// +build: !linux !amd64
 package lxc
 
 func setHostname(hostname string) error {

+ 1 - 0
graphdriver/aufs/mount_darwin.go → graphdriver/aufs/mount_unsupported.go

@@ -1,3 +1,4 @@
+// +build: !linux !amd64
 package aufs
 
 import "errors"

+ 1 - 1
graphdriver/btrfs/dummy_unsupported.go

@@ -1,3 +1,3 @@
-// +build !linux
+// +build !linux !amd64
 
 package btrfs

+ 1 - 0
pkg/mount/flags_darwin.go → pkg/mount/flags_unsupported.go

@@ -1,3 +1,4 @@
+// +build: !linux !amd64
 package mount
 
 func parseOptions(options string) (int, string) {

+ 1 - 0
pkg/mount/mounter_darwin.go → pkg/mount/mounter_unsupported.go

@@ -1,3 +1,4 @@
+// +build: !linux !amd64
 package mount
 
 func mount(device, target, mType string, flag uintptr, data string) error {

+ 1 - 0
pkg/netlink/netlink_darwin.go → pkg/netlink/netlink_unsupported.go

@@ -1,3 +1,4 @@
+// +build: !linux !amd64
 package netlink
 
 import (

+ 1 - 0
reflink_copy_darwin.go → reflink_copy_unsupported.go

@@ -1,3 +1,4 @@
+// +build: !linux !amd64
 package docker
 
 import (

+ 4 - 2
utils/fs.go

@@ -24,10 +24,12 @@ func TreeSize(dir string) (size int64, err error) {
 
 		// Check inode to handle hard links correctly
 		inode := fileInfo.Sys().(*syscall.Stat_t).Ino
-		if _, exists := data[inode]; exists {
+		// inode is not a uint64 on all platforms. Cast it to avoid issues.
+		if _, exists := data[uint64(inode)]; exists {
 			return nil
 		}
-		data[inode] = false
+		// inode is not a uint64 on all platforms. Cast it to avoid issues.
+		data[uint64(inode)] = false
 
 		size += s
 

+ 2 - 1
utils/uname_darwin.go → utils/uname_unsupported.go

@@ -1,3 +1,4 @@
+// +build: !linux !amd64
 package utils
 
 import (
@@ -9,5 +10,5 @@ type Utsname struct {
 }
 
 func uname() (*Utsname, error) {
-	return nil, errors.New("Kernel version detection is not available on darwin")
+	return nil, errors.New("Kernel version detection is available only on linux")
 }