summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);