basicfs_watch_errors_linux.go 528 B

12345678910111213141516171819202122232425
  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. //go:build linux
  7. // +build linux
  8. package fs
  9. import (
  10. "os"
  11. "syscall"
  12. )
  13. func reachedMaxUserWatches(err error) bool {
  14. if pathErr, ok := err.(*os.PathError); ok {
  15. if errno, ok := pathErr.Err.(syscall.Errno); ok {
  16. return errno == 24 || errno == 28
  17. }
  18. }
  19. return false
  20. }