mirror of
https://github.com/dennwc/btrfs
synced 2024-12-22 07:20:05 +00:00
fix fs type detection on 32 bit platforms
This commit is contained in:
parent
a1f570bd01
commit
0167142bde
2
btrfs.go
2
btrfs.go
@ -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)
|
||||
|
3
utils.go
3
utils.go
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user