diff options
Diffstat (limited to 'kvmd/plugins/ugpio/otgconf.py')
-rw-r--r-- | kvmd/plugins/ugpio/otgconf.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/kvmd/plugins/ugpio/otgconf.py b/kvmd/plugins/ugpio/otgconf.py index 4b85a3f4..dc255b02 100644 --- a/kvmd/plugins/ugpio/otgconf.py +++ b/kvmd/plugins/ugpio/otgconf.py @@ -28,7 +28,6 @@ from typing import Any from ...logging import get_logger -from ...inotify import InotifyMask from ...inotify import Inotify from ... import aiotools @@ -82,15 +81,15 @@ class Plugin(BaseUserGpioDriver): await asyncio.sleep(5) with Inotify() as inotify: - await inotify.watch(InotifyMask.ALL_MODIFY_EVENTS, os.path.dirname(self.__udc_path)) - await inotify.watch(InotifyMask.ALL_MODIFY_EVENTS, self.__profile_path) + await inotify.watch_all_modify(os.path.dirname(self.__udc_path)) + await inotify.watch_all_modify(self.__profile_path) self._notifier.notify() while True: need_restart = False need_notify = False for event in (await inotify.get_series(timeout=1)): need_notify = True - if event.mask & (InotifyMask.DELETE_SELF | InotifyMask.MOVE_SELF | InotifyMask.UNMOUNT): + if event.restart: logger.warning("Got fatal inotify event: %s; reinitializing OTG-bind ...", event) need_restart = True break |