Make utils_daemon and volumes cross-platform compileable.

Signed-off-by: Rik Nijessen <riknijessen@gmail.com>
This commit is contained in:
Rik Nijessen
2015-03-16 11:46:07 +01:00
parent 1a5e46ce89
commit 1ec2eac50d
10 changed files with 64 additions and 25 deletions
+5 -6
View File
@@ -8,12 +8,12 @@ import (
"path/filepath"
"sort"
"strings"
"syscall"
log "github.com/Sirupsen/logrus"
"github.com/docker/docker/daemon/execdriver"
"github.com/docker/docker/pkg/chrootarchive"
"github.com/docker/docker/pkg/symlink"
"github.com/docker/docker/pkg/system"
"github.com/docker/docker/volumes"
)
@@ -385,15 +385,14 @@ func copyExistingContents(source, destination string) error {
// copyOwnership copies the permissions and uid:gid of the source file
// into the destination file
func copyOwnership(source, destination string) error {
var stat syscall.Stat_t
if err := syscall.Stat(source, &stat); err != nil {
stat, err := system.Stat(source)
if err != nil {
return err
}
if err := os.Chown(destination, int(stat.Uid), int(stat.Gid)); err != nil {
if err := os.Chown(destination, int(stat.Uid()), int(stat.Gid())); err != nil {
return err
}
return os.Chmod(destination, os.FileMode(stat.Mode))
return os.Chmod(destination, os.FileMode(stat.Mode()))
}