lint: fix trivial clang tidy errors
Change-Id: Ie5395004a451d6168249f56f75c5e6ae31dca4af
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/fail-monitor/monitor.cpp b/fail-monitor/monitor.cpp
index 97316c9..2c4beb7 100644
--- a/fail-monitor/monitor.cpp
+++ b/fail-monitor/monitor.cpp
@@ -38,13 +38,13 @@
void Monitor::analyze()
{
- if (inFailedState(std::move(getSourceUnitPath())))
+ if (inFailedState(getSourceUnitPath()))
{
runTargetAction();
}
}
-bool Monitor::inFailedState(const std::string&& path)
+bool Monitor::inFailedState(const std::string& path)
{
std::variant<std::string> property;
@@ -93,7 +93,8 @@
void Monitor::runTargetAction()
{
// Start or stop the target unit
- auto methodCall = (action == Action::start) ? startMethod : stopMethod;
+ const auto* methodCall =
+ (action == Action::start) ? startMethod : stopMethod;
log<level::INFO>("The source unit is in failed state, "
"running target action",
diff --git a/fail-monitor/monitor.hpp b/fail-monitor/monitor.hpp
index 4393d99..a8a387f 100644
--- a/fail-monitor/monitor.hpp
+++ b/fail-monitor/monitor.hpp
@@ -37,7 +37,7 @@
Monitor(const Monitor&) = delete;
Monitor(Monitor&&) = default;
Monitor& operator=(const Monitor&) = delete;
- Monitor& operator=(Monitor&&) = default;
+ Monitor& operator=(Monitor&&) = delete;
~Monitor() = default;
/**
@@ -49,7 +49,7 @@
*/
Monitor(const std::string& sourceUnit, const std::string& targetUnit,
Action action) :
- bus(std::move(sdbusplus::bus::new_default())),
+ bus(sdbusplus::bus::new_default()),
source(sourceUnit), target(targetUnit), action(action)
{}
@@ -73,7 +73,7 @@
*
* @return - true if this unit is in the failed state
*/
- bool inFailedState(const std::string&& path);
+ bool inFailedState(const std::string& path);
/**
* Runs the action on the target unit.