Skip to content

Commit

Permalink
armhf fix for getfstype (#2884)
Browse files Browse the repository at this point in the history
* armhf fix for getfstype
  • Loading branch information
sabban authored Mar 12, 2024
1 parent 49e0735 commit 1a56a0e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/types/getfstype.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 1a56a0e

Please sign in to comment.