diff options
author | Sebastien Martini <seb@dbzteam.org> | 2012-04-14 18:12:16 +0200 |
---|---|---|
committer | Sebastien Martini <seb@dbzteam.org> | 2012-04-14 18:12:16 +0200 |
commit | e1cbd40ee41ef27e6f91a8b098cd2a0fd6e736f3 (patch) | |
tree | 0893045e57a9b7efd7443d7f945690720c5f4836 | |
parent | 68632f23eac6dd2fbd288616b3e2355be9ad3205 (diff) | |
download | pyinotify-e1cbd40ee41ef27e6f91a8b098cd2a0fd6e736f3.tar.gz |
Fixed runtime warnings in inotify ctypes' wrapper.
Contributed by bdkearns https://github.com/bdkearns
-rwxr-xr-x | python2/pyinotify.py | 8 | ||||
-rwxr-xr-x | python3/pyinotify.py | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/python2/pyinotify.py b/python2/pyinotify.py index 204e381..cb562c5 100755 --- a/python2/pyinotify.py +++ b/python2/pyinotify.py @@ -220,6 +220,14 @@ class _CtypesLibcINotifyWrapper(INotifyWrapper): not hasattr(self._libc, 'inotify_add_watch') or not hasattr(self._libc, 'inotify_rm_watch')): return False + + self._libc.inotify_init.argtypes = [] + self._libc.inotify_init.restype = ctypes.c_int + self._libc.inotify_add_watch.argtypes = [ctypes.c_int, ctypes.c_char_p, + ctypes.c_uint32] + self._libc.inotify_add_watch.restype = ctypes.c_int + self._libc.inotify_rm_watch.argtypes = [ctypes.c_int, ctypes.c_int] + self._libc.inotify_rm_watch.restype = ctypes.c_int return True def _get_errno(self): diff --git a/python3/pyinotify.py b/python3/pyinotify.py index 531c9c9..8d27c1c 100755 --- a/python3/pyinotify.py +++ b/python3/pyinotify.py @@ -214,6 +214,14 @@ class _CtypesLibcINotifyWrapper(INotifyWrapper): not hasattr(self._libc, 'inotify_add_watch') or not hasattr(self._libc, 'inotify_rm_watch')): return False + + self._libc.inotify_init.argtypes = [] + self._libc.inotify_init.restype = ctypes.c_int + self._libc.inotify_add_watch.argtypes = [ctypes.c_int, ctypes.c_char_p, + ctypes.c_uint32] + self._libc.inotify_add_watch.restype = ctypes.c_int + self._libc.inotify_rm_watch.argtypes = [ctypes.c_int, ctypes.c_int] + self._libc.inotify_rm_watch.restype = ctypes.c_int return True def _get_errno(self): |