summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>2013-01-04 16:45:28 +0100
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>2013-01-04 16:45:28 +0100
commit32ce17d193f4e529bc393dcedc69e77e389d5ea1 (patch)
tree268409ee83a190a652597224f73755992c32dd0b
parentc8a24889362031264661f3124d59f076d9526502 (diff)
downloadvdr-plugin-inputdev-32ce17d193f4e529bc393dcedc69e77e389d5ea1.tar.gz
vdr-plugin-inputdev-32ce17d193f4e529bc393dcedc69e77e389d5ea1.tar.bz2
changed close() method to take an l-value which is reset by it
-rw-r--r--inputdev.cc7
-rw-r--r--inputdev.h2
2 files changed, 5 insertions, 4 deletions
diff --git a/inputdev.cc b/inputdev.cc
index 4ddf6e1..30a15af 100644
--- a/inputdev.cc
+++ b/inputdev.cc
@@ -580,10 +580,12 @@ char const *cInputDeviceController::plugin_name(void) const
return plugin_.Name();
}
-void cInputDeviceController::close(int fd)
+void cInputDeviceController::close(int &fd)
{
- if (fd != -1)
+ if (fd != -1) {
::close(fd);
+ fd = -1;
+ }
}
bool cInputDeviceController::open_generic(int fd_udev)
@@ -980,6 +982,5 @@ void cInputDeviceController::stop(void)
{
Cancel(-1);
this->close(fd_epoll_);
- fd_epoll_ = -1;
Cancel(5);
}
diff --git a/inputdev.h b/inputdev.h
index 56ed0b8..7038442 100644
--- a/inputdev.h
+++ b/inputdev.h
@@ -65,7 +65,7 @@ public:
void remove_device(char const *dev);
void remove_device(class cInputDevice *dev);
- static void close(int fd);
+ static void close(int &fd);
bool Put(uint64_t Code, bool Repeat, bool Release) {
return cRemote::Put(Code, Repeat, Release);