Fix OS X build

- Explicitly cast statfs_t members to int64 (this structure is
   platform-specific)
 - Add pass-through New methods to Darwin SHA package
 - Move scsi pkg types to common translation unit (package was empty)
 - Add stub implementations mount/disk ops for OS X
This commit is contained in:
Nate Rosenblum
2015-07-13 08:26:40 -07:00
parent 74e44cd0c4
commit ec347f96fd
9 changed files with 80 additions and 26 deletions

View File

@@ -63,8 +63,8 @@ func New(diskPath string) (Disk, error) {
disk.fsInfo["MountPoint"] = disk.path
return disk, nil
}
return Disk{}, iodine.New(UnsupportedFilesystem{Type: strconv.FormatInt(s.Type, 10)},
map[string]string{"Type": strconv.FormatInt(s.Type, 10)})
return Disk{}, iodine.New(UnsupportedFilesystem{Type: strconv.FormatInt(int64(s.Type), 10)},
map[string]string{"Type": strconv.FormatInt(int64(s.Type), 10)})
}
// GetPath - get root disk path
@@ -82,10 +82,10 @@ func (disk Disk) GetFSInfo() map[string]string {
if err != nil {
return nil
}
disk.fsInfo["Total"] = formatBytes(s.Bsize * int64(s.Blocks))
disk.fsInfo["Free"] = formatBytes(s.Bsize * int64(s.Bfree))
disk.fsInfo["TotalB"] = strconv.FormatInt(s.Bsize*int64(s.Blocks), 10)
disk.fsInfo["FreeB"] = strconv.FormatInt(s.Bsize*int64(s.Bfree), 10)
disk.fsInfo["Total"] = formatBytes(int64(s.Bsize) * int64(s.Blocks))
disk.fsInfo["Free"] = formatBytes(int64(s.Bsize) * int64(s.Bfree))
disk.fsInfo["TotalB"] = strconv.FormatInt(int64(s.Bsize)*int64(s.Blocks), 10)
disk.fsInfo["FreeB"] = strconv.FormatInt(int64(s.Bsize)*int64(s.Bfree), 10)
return disk.fsInfo
}