mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
update for smartos build (solaris too) (#10378)
This commit is contained in:
@@ -215,7 +215,7 @@ func TestCheckPortAvailability(t *testing.T) {
|
||||
|
||||
for _, testCase := range testCases {
|
||||
// On MS Windows and Mac, skip checking error case due to https://github.com/golang/go/issues/7598
|
||||
if (runtime.GOOS == globalWindowsOSName || runtime.GOOS == globalMacOSName) && testCase.expectedErr != nil {
|
||||
if (runtime.GOOS == globalWindowsOSName || runtime.GOOS == globalMacOSName || runtime.GOOS == "solaris") && testCase.expectedErr != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ func readDirN(dirPath string, count int) (entries []string, err error) {
|
||||
}
|
||||
return nil, osErrToFileErr(err)
|
||||
}
|
||||
if count > 0 {
|
||||
if count > -1 {
|
||||
if remaining <= len(fis) {
|
||||
fis = fis[:remaining]
|
||||
done = true
|
||||
|
||||
@@ -68,12 +68,16 @@ func isSysErrTooManySymlinks(err error) bool {
|
||||
return errors.Is(err, syscall.ELOOP)
|
||||
}
|
||||
|
||||
// Check if the given error corresponds to ENOTEMPTY for unix
|
||||
// Check if the given error corresponds to ENOTEMPTY for unix,
|
||||
// EEXIST for solaris variants,
|
||||
// and ERROR_DIR_NOT_EMPTY for windows (directory not empty).
|
||||
func isSysErrNotEmpty(err error) bool {
|
||||
if errors.Is(err, syscall.ENOTEMPTY) {
|
||||
return true
|
||||
}
|
||||
if errors.Is(err, syscall.EEXIST) && runtime.GOOS == "solaris" {
|
||||
return true
|
||||
}
|
||||
var pathErr *os.PathError
|
||||
if errors.As(err, &pathErr) {
|
||||
if runtime.GOOS == globalWindowsOSName {
|
||||
|
||||
Reference in New Issue
Block a user