fix fs type detection on 32 bit platforms

This commit is contained in:
Riccardo Ferrazzo 2024-04-16 20:52:58 +02:00 committed by Denys Smirnov
parent a1f570bd01
commit 0167142bde
2 changed files with 3 additions and 2 deletions

View File

@ -11,7 +11,7 @@ import (
"github.com/dennwc/ioctl"
)
const SuperMagic = 0x9123683E
const SuperMagic uint32 = 0x9123683E
func CloneFile(dst, src *os.File) error {
return iocClone(dst, src)

View File

@ -17,7 +17,8 @@ func isBtrfs(path string) (bool, error) {
if err := syscall.Statfs(path, &stfs); err != nil {
return false, &os.PathError{Op: "statfs", Path: path, Err: err}
}
return int64(stfs.Type) == SuperMagic, nil
fsType := uint32(stfs.Type)
return fsType == SuperMagic, nil
}
func findMountRoot(path string) (string, error) {