mirror of
https://github.com/clearlinux/docker.git
synced 2026-10-03 23:38:24 +00:00
Make utils_daemon and volumes cross-platform compileable.
Signed-off-by: Rik Nijessen <riknijessen@gmail.com>
This commit is contained in:
+5
-6
@@ -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()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user