Make minio server compile on OpenBSD, NetBSD, Solaris (#3719)

This commit is contained in:
Krishnan Parthasarathi
2017-02-09 11:57:35 +05:30
committed by Harshavardhana
parent 0c7694894b
commit e5773e11c6
24 changed files with 545 additions and 141 deletions

View File

@@ -153,11 +153,20 @@ func getDiskInfo(diskPath string) (di disk.Info, err error) {
return di, err
}
// List of operating systems where we ignore disk space
// verification.
var ignoreDiskFreeOS = []string{
globalWindowsOSName,
globalNetBSDOSName,
globalSolarisOSName,
}
// checkDiskFree verifies if disk path has sufficient minimum free disk space and files.
func (s *posix) checkDiskFree() (err error) {
// We don't validate disk space or inode utilization on windows.
// Each windows calls to 'GetVolumeInformationW' takes around 3-5seconds.
if runtime.GOOS == globalWindowsOSName {
// And StatFS is not supported by Go for solaris and netbsd.
if contains(ignoreDiskFreeOS, runtime.GOOS) {
return nil
}