From 774f9af9a2d861f49c878d9eeca9830bef44127b Mon Sep 17 00:00:00 2001 From: Eddie James Date: Tue, 19 Mar 2019 20:58:53 +0000 Subject: Fix error attribute naming for Linux 5.0 There was a slight change to one of the error attributes as part of the OCC driver upstreaming process. This commit also adds unit tests for the error attributes. This required some refactoring to support the unit tests. Resolves openbmc/openbmc#3505 Signed-off-by: Eddie James Change-Id: I665b46e44b18befc8a728f7246bcda82f1f1a71c --- occ_errors.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'occ_errors.cpp') diff --git a/occ_errors.cpp b/occ_errors.cpp index ae66a62..ab7663a 100644 --- a/occ_errors.cpp +++ b/occ_errors.cpp @@ -56,15 +56,18 @@ void Error::registerCallBack() } // Starts to watch for errors -void Error::addWatch() +void Error::addWatch(bool poll) { if (!watching) { // Open the file openFile(); - // register the callback handler - registerCallBack(); + if (poll) + { + // register the callback handler + registerCallBack(); + } // Set we are watching the error watching = true; -- cgit v1.2.1