0001-Add-a-workaround-to-support-uClibc-library.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From c3b3c4581b25d7e62f5c2ce1484133229d5e657a Mon Sep 17 00:00:00 2001
  2. From: Yegor Yefremov <yegorslists@googlemail.com>
  3. Date: Fri, 16 Feb 2018 13:26:23 +0100
  4. Subject: [PATCH] Add a workaround to support uClibc library
  5. uClibc based systems provide only libc.so.0 and libc.so.1
  6. symlinks.
  7. So try to find libc.so.0 if neither libc.so nor libc.so.6
  8. could be found.
  9. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
  10. ---
  11. src/watchdog/observers/inotify_c.py | 12 ++++++++++++
  12. 1 file changed, 12 insertions(+)
  13. diff --git a/src/watchdog/observers/inotify_c.py b/src/watchdog/observers/inotify_c.py
  14. index 5f208b6..0dc7b50 100644
  15. --- a/src/watchdog/observers/inotify_c.py
  16. +++ b/src/watchdog/observers/inotify_c.py
  17. @@ -45,7 +45,19 @@ def _load_libc():
  18. try:
  19. return ctypes.CDLL('libc.so')
  20. except (OSError, IOError):
  21. + pass
  22. +
  23. + try:
  24. return ctypes.CDLL('libc.so.6')
  25. + except (OSError, IOError):
  26. + pass
  27. +
  28. + # uClibc
  29. + try:
  30. + return ctypes.CDLL('libc.so.0')
  31. + except (OSError, IOError) as err:
  32. + raise err
  33. +
  34. libc = _load_libc()
  35. --
  36. 2.1.4