diff options
Diffstat (limited to 'devel/py-inotify-simple/files/patch-inotify__simple.py')
-rw-r--r-- | devel/py-inotify-simple/files/patch-inotify__simple.py | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/devel/py-inotify-simple/files/patch-inotify__simple.py b/devel/py-inotify-simple/files/patch-inotify__simple.py index 346f1722618b..2b8929facf1a 100644 --- a/devel/py-inotify-simple/files/patch-inotify__simple.py +++ b/devel/py-inotify-simple/files/patch-inotify__simple.py @@ -1,28 +1,11 @@ ---- inotify_simple.py.orig 2020-08-06 00:20:49 UTC +--- inotify_simple.py.orig 2025-08-25 06:27:48 UTC +++ inotify_simple.py -@@ -4,6 +4,7 @@ from enum import Enum, IntEnum - from collections import namedtuple - from struct import unpack_from, calcsize - from select import poll -+from select import POLLIN - from time import sleep - from ctypes import CDLL, get_errno, c_int - from ctypes.util import find_library -@@ -82,7 +83,7 @@ class INotify(FileIO): - manually with ``os.read(fd)``) to raise ``BlockingIOError`` if no data - is available.""" - try: -- libc_so = find_library('c') -+ libc_so = find_library('inotify') - except RuntimeError: # Python on Synology NASs raises a RuntimeError - libc_so = None - global _libc; _libc = _libc or CDLL(libc_so or 'libc.so.6', use_errno=True) -@@ -90,7 +91,7 @@ class INotify(FileIO): - flags = (not inheritable) * O_CLOEXEC | bool(nonblocking) * os.O_NONBLOCK - FileIO.__init__(self, _libc_call(_libc.inotify_init1, flags), mode='rb') - self._poller = poll() -- self._poller.register(self.fileno()) -+ self._poller.register(self.fileno(), POLLIN) - - def add_watch(self, path, mask): - """Wrapper around ``inotify_add_watch()``. Returns the watch +@@ -76,7 +76,7 @@ class INotify(FileIO): + object is garbage collected or when `~inotify_simple.INotify.close` is + called.""" + +- global _libc; _libc = _libc or CDLL(find_library('c'), use_errno=True) ++ global _libc; _libc = _libc or CDLL(find_library('inotify'), use_errno=True) + flags = (not inheritable) * os.O_CLOEXEC | bool(nonblocking) * os.O_NONBLOCK + fd = _libc_call(_libc.inotify_init1, flags) + super().__init__(fd, mode='rb', closefd=closefd) |