Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

armhf fix for getfstype #2884

Merged
merged 2 commits into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading