From ba52130873395a44d637fc57f98ed174f0ac87bb Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 15 Jan 2014 10:07:47 +0100 Subject: [PATCH] Fix cross compile stat.Rdev and time.* is 32bit on OSX, which breaks cross builds with eg: cannot use stat.Rdev (type int32) as type uint64 in function argument We fix this with an extra conversion to uint64. Docker-DCO-1.1-Signed-off-by: Alexander Larsson (github: alexlarsson) --- archive/changes.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/archive/changes.go b/archive/changes.go index 5fc56b8863..c67bec8ce2 100644 --- a/archive/changes.go +++ b/archive/changes.go @@ -361,8 +361,8 @@ func ExportChanges(dir string, changes []Change) (Archive, error) { Mode: int64(stat.Mode & 07777), Uid: int(stat.Uid), Gid: int(stat.Gid), - ModTime: time.Unix(mtim.Sec, mtim.Nsec), - AccessTime: time.Unix(atim.Sec, atim.Nsec), + ModTime: time.Unix(int64(mtim.Sec), int64(mtim.Nsec)), + AccessTime: time.Unix(int64(atim.Sec), int64(atim.Nsec)), } if stat.Mode&syscall.S_IFDIR == syscall.S_IFDIR { @@ -382,8 +382,8 @@ func ExportChanges(dir string, changes []Change) (Archive, error) { } else { hdr.Typeflag = tar.TypeChar } - hdr.Devmajor = int64(major(stat.Rdev)) - hdr.Devminor = int64(minor(stat.Rdev)) + hdr.Devmajor = int64(major(uint64(stat.Rdev))) + hdr.Devminor = int64(minor(uint64(stat.Rdev))) } else if stat.Mode&syscall.S_IFIFO == syscall.S_IFIFO || stat.Mode&syscall.S_IFSOCK == syscall.S_IFSOCK { hdr.Typeflag = tar.TypeFifo