summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>2012-12-26 17:30:37 +0100
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>2012-12-26 17:30:37 +0100
commit93fb29642286df305fd9f68830dad34a12fca5b5 (patch)
tree8c8e58394322a6d98146ac275696a0d8cc674f64
parent892dd3c27279efdcf1dc8236ae7ab1cc5ef2f5ff (diff)
downloadvdr-plugin-inputdev-93fb29642286df305fd9f68830dad34a12fca5b5.tar.gz
vdr-plugin-inputdev-93fb29642286df305fd9f68830dad34a12fca5b5.tar.bz2
remove devices when it has been unplugged from system
-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(),