basicfs_watch_errors_linux.go 511 B

1234567891011121314151617181920212223
  1. // Copyright (C) 2016 The Syncthing Authors.
  2. //
  3. // This Source Code Form is subject to the terms of the Mozilla Public
  4. // License, v. 2.0. If a copy of the MPL was not distributed with this file,
  5. // You can obtain one at http://mozilla.org/MPL/2.0/.
  6. // +build linux
  7. package fs
  8. import (
  9. "os"
  10. "syscall"
  11. )
  12. func reachedMaxUserWatches(err error) bool {
  13. if pathErr, ok := err.(*os.PathError); ok {
  14. if errno, ok := pathErr.Err.(syscall.Errno); ok {
  15. return errno == 24 || errno == 28
  16. }
  17. }
  18. return false
  19. }