Skip to content
Permalink
Browse files

sysutils/docker-engine: Add various patches because Rdev is uint64 on…

… FreeBSD

but int on most other platforms including Linux. So all this castings to int
are failing.
  • Loading branch information...
decke committed Jun 24, 2019
1 parent e32b568 commit 1efa338b8e61392480142b7f1f5b0217866c149e
@@ -1,11 +1,11 @@
--- pkg/archive/archive_unix.go.orig 2019-06-18 21:30:11 UTC
--- pkg/archive/archive_unix.go.orig 2019-06-24 10:21:29 UTC
+++ pkg/archive/archive_unix.go
@@ -63,7 +63,7 @@ func getInodeFromStat(stat interface{}) (inode uint64,
s, ok := stat.(*syscall.Stat_t)

if ok {
- inode = s.Ino
+ inode = uint64(s.Ino)
@@ -96,7 +96,7 @@ func handleTarTypeBlockCharFifo(hdr *tar.Header, path
mode |= unix.S_IFIFO
}

return
- return system.Mknod(path, mode, int(system.Mkdev(hdr.Devmajor, hdr.Devminor)))
+ return system.Mknod(path, mode, uint64(system.Mkdev(hdr.Devmajor, hdr.Devminor)))
}

func handleLChmod(hdr *tar.Header, path string, hdrInfo os.FileInfo) error {
@@ -0,0 +1,11 @@
--- pkg/system/mknod.go.orig 2019-06-18 21:30:11 UTC
+++ pkg/system/mknod.go
@@ -8,7 +8,7 @@ import (

// Mknod creates a filesystem node (file, device special file or named pipe) named path
// with attributes specified by mode and dev.
-func Mknod(path string, mode uint32, dev int) error {
+func Mknod(path string, mode uint32, dev uint64) error {
return unix.Mknod(path, mode, dev)
}

@@ -0,0 +1,11 @@
--- vendor/github.com/containerd/containerd/archive/tar_unix.go.orig 2019-06-18 21:30:11 UTC
+++ vendor/github.com/containerd/containerd/archive/tar_unix.go
@@ -122,7 +122,7 @@ func handleTarTypeBlockCharFifo(hdr *tar.Header, path
mode |= unix.S_IFIFO
}

- return unix.Mknod(path, mode, int(unix.Mkdev(uint32(hdr.Devmajor), uint32(hdr.Devminor))))
+ return unix.Mknod(path, mode, unix.Mkdev(uint32(hdr.Devmajor), uint32(hdr.Devminor)))
}

func handleLChmod(hdr *tar.Header, path string, hdrInfo os.FileInfo) error {
@@ -0,0 +1,11 @@
--- vendor/github.com/containerd/continuity/devices/devices_unix.go.orig 2019-06-18 21:30:11 UTC
+++ vendor/github.com/containerd/continuity/devices/devices_unix.go
@@ -55,7 +55,7 @@ func Mknod(p string, mode os.FileMode, maj, min int) e
m |= unix.S_IFIFO
}

- return unix.Mknod(p, m, int(dev))
+ return unix.Mknod(p, m, dev)
}

// syscallMode returns the syscall-specific mode bits from Go's portable mode bits.
@@ -0,0 +1,9 @@
--- vendor/github.com/containerd/continuity/fs/copy_unix.go.orig 2019-06-18 21:30:11 UTC
+++ vendor/github.com/containerd/continuity/fs/copy_unix.go
@@ -108,5 +108,5 @@ func copyDevice(dst string, fi os.FileInfo) error {
if !ok {
return errors.New("unsupported stat type")
}
- return unix.Mknod(dst, uint32(fi.Mode()), int(st.Rdev))
+ return unix.Mknod(dst, uint32(fi.Mode()), st.Rdev)
}
@@ -0,0 +1,9 @@
--- vendor/github.com/tonistiigi/fsutil/copy/copy_unix.go.orig 2019-06-18 21:30:11 UTC
+++ vendor/github.com/tonistiigi/fsutil/copy/copy_unix.go
@@ -64,5 +64,5 @@ func copyDevice(dst string, fi os.FileInfo) error {
if !ok {
return errors.New("unsupported stat type")
}
- return unix.Mknod(dst, uint32(fi.Mode()), int(st.Rdev))
+ return unix.Mknod(dst, uint32(fi.Mode()), st.Rdev)
}

0 comments on commit 1efa338

Please sign in to comment.
You can’t perform that action at this time.