Skip to content

Commit

Permalink
www/minio: Unbreak on i386
Browse files Browse the repository at this point in the history
vendor/github.com/minio/mc/pkg/disk/stat_freebsd.go:38:41: cannot use st.Atimespec.Sec (variable of type int32) as type int64 in argument to strconv.FormatInt
vendor/github.com/minio/mc/pkg/disk/stat_freebsd.go:38:89: cannot use st.Atimespec.Nsec (variable of type int32) as type int64 in argument to strconv.FormatInt
vendor/github.com/minio/mc/pkg/disk/stat_freebsd.go:51:41: cannot use st.Mtimespec.Sec (variable of type int32) as type int64 in argument to strconv.FormatInt
vendor/github.com/minio/mc/pkg/disk/stat_freebsd.go:51:89: cannot use st.Mtimespec.Nsec (variable of type int32) as type int64 in argument to strconv.FormatInt

Convert syscall.Timespec fields to int64 on all archs.

Reported by:	fallout
Approved by:	portmgr (blanket, build fix)
  • Loading branch information
dmgk committed Jul 17, 2022
1 parent 0cc44b4 commit 9cb58b7
Showing 1 changed file with 20 additions and 0 deletions.
@@ -0,0 +1,20 @@
--- vendor/github.com/minio/mc/pkg/disk/stat_freebsd.go.orig 2022-07-17 15:41:36 UTC
+++ vendor/github.com/minio/mc/pkg/disk/stat_freebsd.go
@@ -35,7 +35,7 @@ func GetFileSystemAttrs(file string) (string, error) {

var fileAttr strings.Builder
fileAttr.WriteString("atime:")
- fileAttr.WriteString(strconv.FormatInt(st.Atimespec.Sec, 10) + "#" + strconv.FormatInt(st.Atimespec.Nsec, 10))
+ fileAttr.WriteString(strconv.FormatInt(int64(st.Atimespec.Sec), 10) + "#" + strconv.FormatInt(int64(st.Atimespec.Nsec), 10))
fileAttr.WriteString("/gid:")
fileAttr.WriteString(strconv.Itoa(int(st.Gid)))

@@ -48,7 +48,7 @@ func GetFileSystemAttrs(file string) (string, error) {
fileAttr.WriteString("/mode:")
fileAttr.WriteString(strconv.Itoa(int(st.Mode)))
fileAttr.WriteString("/mtime:")
- fileAttr.WriteString(strconv.FormatInt(st.Mtimespec.Sec, 10) + "#" + strconv.FormatInt(st.Mtimespec.Nsec, 10))
+ fileAttr.WriteString(strconv.FormatInt(int64(st.Mtimespec.Sec), 10) + "#" + strconv.FormatInt(int64(st.Mtimespec.Nsec), 10))
fileAttr.WriteString("/uid:")
fileAttr.WriteString(strconv.Itoa(int(st.Uid)))

0 comments on commit 9cb58b7

Please sign in to comment.