fork/gdu
git clone https://git.julia.blue/fork/gdu
ede21d2
ignore
1//go:build netbsd 2 3package device 4 5import ( 6"strings" 7 8"golang.org/x/sys/unix" 9) 10 11func processMounts (mounts Devices ,ignoreErrors bool ) (devices Devices ,err error ) { 12for _ ,mount := range mounts { 13if strings .HasPrefix (mount .Name ,"/dev" )|| mount .Fstype == "zfs" { 14info := & unix.Statvfs_t {} 15err = unix .Statvfs (mount .MountPoint ,info ) 16if err != nil && ! ignoreErrors { 17return nil ,err 18 } 19 20mount .Size = int64 (info .Bsize )* int64 (info .Blocks ) 21mount .Free = int64 (info .Bsize )* int64 (info .Bavail ) 22 23devices = append (devices ,mount ) 24 } 25 } 26 27return devices ,nil 28}