Skip to content

Commit

Permalink
Add a workaround to support uClibc library
Browse files Browse the repository at this point in the history
uClibc based systems provide only libc.so.0 and libc.so.1
symlinks.

So try to find libc.so.0 if neither libc.so nor libc.so.6
could be found.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
  • Loading branch information
yegorich committed Apr 30, 2018
1 parent d33bee0 commit 268a46d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/watchdog/observers/inotify_c.py
Expand Up @@ -45,7 +45,19 @@ def _load_libc():
try:
return ctypes.CDLL('libc.so')
except (OSError, IOError):
pass

try:
return ctypes.CDLL('libc.so.6')
except (OSError, IOError):
pass

# uClibc
try:
return ctypes.CDLL('libc.so.0')
except (OSError, IOError) as err:
raise err


libc = _load_libc()

Expand Down

0 comments on commit 268a46d

Please sign in to comment.