From 1a56a0e0b9fb5c56e4cee6d3267e758d2885bf25 Mon Sep 17 00:00:00 2001 From: Manuel Sabban Date: Tue, 12 Mar 2024 14:33:10 +0100 Subject: [PATCH] armhf fix for getfstype (#2884) * armhf fix for getfstype --- pkg/types/getfstype.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/types/getfstype.go b/pkg/types/getfstype.go index 4a54fc948..a7ee249cd 100644 --- a/pkg/types/getfstype.go +++ b/pkg/types/getfstype.go @@ -4,13 +4,13 @@ package types import ( "fmt" - "syscall" + "golang.org/x/sys/unix" ) // Generated with `man statfs | grep _MAGIC | awk '{split(tolower($1),a,"_"); print $2 ": \"" a[1] "\","}'` // ext2/3/4 duplicates removed to just have ext4 // XIAFS removed as well -var fsTypeMapping map[int]string = map[int]string{ +var fsTypeMapping map[int64]string = map[int64]string{ 0xadf5: "adfs", 0xadff: "affs", 0x5346414f: "afs", @@ -95,15 +95,15 @@ var fsTypeMapping map[int]string = map[int]string{ } func GetFSType(path string) (string, error) { - var buf syscall.Statfs_t + var buf unix.Statfs_t - err := syscall.Statfs(path, &buf) + err := unix.Statfs(path, &buf) if err != nil { return "", err } - fsType, ok := fsTypeMapping[int(buf.Type)] + fsType, ok := fsTypeMapping[buf.Type] if !ok { return "", fmt.Errorf("unknown fstype %d", buf.Type) }