summaryrefslogtreecommitdiffstats
path: root/monitor.hpp
diff options
context:
space:
mode:
authorVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2017-06-19 15:51:01 +0530
committerVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2017-06-19 23:55:36 +0530
commitba8de42135766deab2125a784a89d3e51bc2e194 (patch)
treec3f824a8fda26550eb1da81f9cd00abf034b37c2 /monitor.hpp
parente3b859ca45f17386257fa4e506acd266a18f1aa3 (diff)
downloadphosphor-gpio-monitor-ba8de42135766deab2125a784a89d3e51bc2e194.tar.gz
phosphor-gpio-monitor-ba8de42135766deab2125a784a89d3e51bc2e194.zip
Fix incorrect initialization of evdev
Fixes openbmc/openbmc#1799 Change-Id: I81662ede88d1a05db48686ec57aab969c8dea27a Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
Diffstat (limited to 'monitor.hpp')
-rw-r--r--monitor.hpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/monitor.hpp b/monitor.hpp
index 68bf447..bffb1d4 100644
--- a/monitor.hpp
+++ b/monitor.hpp
@@ -66,13 +66,15 @@ class Monitor
* @param[in] event - sd_event handler
* @param[in] handler - IO callback handler. Defaults to one in this
* class
+ * @param[in] useEvDev - Whether to use EvDev to retrieve events
*/
Monitor(const std::string& path,
decltype(input_event::code) key,
decltype(input_event::value) polarity,
const std::string& target,
EventPtr& event,
- sd_event_io_handler_t handler = Monitor::processEvents)
+ sd_event_io_handler_t handler = Monitor::processEvents,
+ bool useEvDev = true)
: path(path),
key(key),
polarity(polarity),
@@ -81,6 +83,12 @@ class Monitor
callbackHandler(handler),
fd(openDevice())
{
+ if (useEvDev)
+ {
+ // If we are asked to use EvDev, do that initialization.
+ initEvDev();
+ }
+
// And register callback handler when FD has some data
registerCallback();
}
OpenPOWER on IntegriCloud