update for smartos build (solaris too) (#10378)

This commit is contained in:
Gaige B Paulsen
2020-08-31 13:19:25 -04:00
committed by GitHub
parent f04a1f220c
commit 859ef52886
5 changed files with 26 additions and 11 deletions
+5 -1
View File
@@ -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 {