summaryrefslogtreecommitdiff
path: root/inputdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'inputdev.c')
-rw-r--r--inputdev.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/inputdev.c b/inputdev.c
index 8c2c82c..2a168e4 100644
--- a/inputdev.c
+++ b/inputdev.c
@@ -295,7 +295,14 @@ void cInputDevice::handle(void)
rc = read(fd_, &ev, sizeof ev);
if (rc < 0 && errno == EINTR)
return;
-
+
+ if (rc < 0 && errno == ENODEV) {
+ isyslog("%s: device '%s' removed\n",
+ controller_.plugin_name(), get_dev_path());
+ controller_.remove_device(this);
+ return;
+ }
+
if (rc < 0) {
esyslog("%s: failed to read from %s: %s\n",
controller_.plugin_name(), get_dev_path(),