lib/fs: Fix and update error about inotify watch limit (fixes #4833) (#4835)

This commit is contained in:
Simon Frei
2018-03-23 12:56:38 +01:00
committed by Jakob Borg
parent e7dc2f9190
commit da3b38ccce
4 changed files with 39 additions and 26 deletions

View File

@@ -8,11 +8,16 @@
package fs
import "syscall"
import (
"os"
"syscall"
)
func reachedMaxUserWatches(err error) bool {
if errno, ok := err.(syscall.Errno); ok {
return errno == 24 || errno == 28
if pathErr, ok := err.(*os.PathError); ok {
if errno, ok := pathErr.Err.(syscall.Errno); ok {
return errno == 24 || errno == 28
}
}
return false
}