Merge pull request #68 from filecoin-project/fix/darwin

Fix build on osx
This commit is contained in:
Łukasz Magiera 2020-07-09 20:46:11 +02:00 committed by GitHub
commit f0dae546b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -13,5 +13,5 @@ var log = logging.Logger("fsutil")
func Deallocate(file *os.File, offset int64, length int64) error {
log.Warnf("deallocating space not supported")
return err
return nil
}

View File

@ -20,6 +20,6 @@ func FileSize(path string) (SizeInfo, error) {
// NOTE: stat.Blocks is in 512B blocks, NOT in stat.Blksize
// See https://www.gnu.org/software/libc/manual/html_node/Attribute-Meanings.html
return SizeInfo{
stat.Blocks * 512,
int64(stat.Blocks) * 512,
}, nil
}

View File

@ -13,7 +13,7 @@ func Statfs(path string) (FsStat, error) {
}
return FsStat{
Capacity: int64(stat.Blocks) * stat.Bsize,
Available: int64(stat.Bavail) * stat.Bsize,
Capacity: int64(stat.Blocks) * int64(stat.Bsize),
Available: int64(stat.Bavail) * int64(stat.Bsize),
}, nil
}