SecBSD's official ports repository

This commit is contained in:
purplerain 2023-08-16 22:26:55 +00:00
commit 2c0afcbbf3
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
64331 changed files with 5339189 additions and 0 deletions

View file

@ -0,0 +1,22 @@
Index: agent/fileutil/fileutil_unix.go
--- agent/fileutil/fileutil_unix.go.orig
+++ agent/fileutil/fileutil_unix.go
@@ -100,14 +100,14 @@ func GetDiskSpaceInfo() (diskSpaceInfo DiskSpaceInfo,
syscall.Statfs(wd, &stat)
// get block size
- bSize := uint64(stat.Bsize)
+ bSize := uint64(stat.F_bsize)
// return DiskSpaceInfo with calculated bytes
return DiskSpaceInfo{
// On Linux the struct statfs.f_bavail field is unsigned, but on FreeBSD the field is an int64
- AvailBytes: (int64)((uint64)(stat.Bavail) * bSize), // available space = # of available blocks * block size
- FreeBytes: (int64)(stat.Bfree * bSize), // free space = # of free blocks * block size
- TotalBytes: (int64)(stat.Blocks * bSize), // total space = # of total blocks * block size
+ AvailBytes: (int64)((uint64)(stat.F_bavail) * bSize), // available space = # of available blocks * block size
+ FreeBytes: (int64)(stat.F_bfree * bSize), // free space = # of free blocks * block size
+ TotalBytes: (int64)(stat.F_blocks * bSize), // total space = # of total blocks * block size
}, nil
}