diff options
author | Devaev Maxim <[email protected]> | 2020-10-03 05:31:52 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-10-03 05:31:52 +0300 |
commit | 9db6a4a6b415c34ea962376edbf1a615bb1b45bd (patch) | |
tree | 2ba1b6a82fd120972c7b036f60b89134defd51cf | |
parent | 792f94d9e8fcb7124fe3b292e6bc2a1339c6b464 (diff) |
handle ESHUTDOWN during hid write()
https://github.com/raspberrypi/linux/commit/61b7f805dc2fd364e0df682de89227e94ce88e25
-rw-r--r-- | kvmd/plugins/hid/otg/device.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kvmd/plugins/hid/otg/device.py b/kvmd/plugins/hid/otg/device.py index b777dd56..e4ed5500 100644 --- a/kvmd/plugins/hid/otg/device.py +++ b/kvmd/plugins/hid/otg/device.py @@ -162,7 +162,11 @@ class BaseDeviceProcess(multiprocessing.Process): # pylint: disable=too-many-in logger.error("HID-%s write() error: written (%s) != report length (%d)", self.__name, written, len(report)) except Exception as err: - if isinstance(err, OSError) and err.errno == errno.EAGAIN: # pylint: disable=no-member + if isinstance(err, OSError) and ( + # https://github.com/raspberrypi/linux/commit/61b7f805dc2fd364e0df682de89227e94ce88e25 + err.errno == errno.EAGAIN + or err.errno == errno.ESHUTDOWN + ): logger.debug("HID-%s busy/unplugged (write): %s: %s", self.__name, type(err).__name__, err) else: |