Skip to content

Commit

Permalink
Fixed runtime warnings in inotify ctypes' wrapper.
Browse files Browse the repository at this point in the history
  • Loading branch information
seb-m committed Apr 14, 2012
1 parent 68632f2 commit e1cbd40
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python2/pyinotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,14 @@ def init(self):
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):
Expand Down
8 changes: 8 additions & 0 deletions python3/pyinotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,14 @@ def init(self):
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):
Expand Down

0 comments on commit e1cbd40

Please sign in to comment.