diff options
author | Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> | 2012-12-26 17:30:37 +0100 |
---|---|---|
committer | Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> | 2012-12-26 17:30:37 +0100 |
commit | 93fb29642286df305fd9f68830dad34a12fca5b5 (patch) | |
tree | 8c8e58394322a6d98146ac275696a0d8cc674f64 | |
parent | 892dd3c27279efdcf1dc8236ae7ab1cc5ef2f5ff (diff) | |
download | vdr-plugin-inputdev-93fb29642286df305fd9f68830dad34a12fca5b5.tar.gz vdr-plugin-inputdev-93fb29642286df305fd9f68830dad34a12fca5b5.tar.bz2 |
remove devices when it has been unplugged from system
-rw-r--r-- | inputdev.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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(), |