Refactor: Move watch to ubi
watch is ubi specific functions, move it to ubi dir.
Tested: On the last commit of the patch series, run code update and
factory reset on Witherspoon and all work fine.
Change-Id: Ia7f6b6de845ddd40e2a32ad626d3b7af9074c7f3
Signed-off-by: Lei YU <mine260309@gmail.com>
diff --git a/item_updater_main.cpp b/item_updater_main.cpp
index d0d7554..e54239a 100644
--- a/item_updater_main.cpp
+++ b/item_updater_main.cpp
@@ -2,8 +2,8 @@
#ifdef UBIFS_LAYOUT
#include "ubi/item_updater_ubi.hpp"
+#include "ubi/watch.hpp"
#endif
-#include "watch.hpp"
#include <phosphor-logging/log.hpp>
#include <sdbusplus/bus.hpp>
@@ -35,10 +35,12 @@
bus.request_name(BUSNAME_UPDATER);
try
{
+#ifdef UBIFS_LAYOUT
openpower::software::updater::Watch watch(
loop,
std::bind(std::mem_fn(&ItemUpdater::updateFunctionalAssociation),
&updater, std::placeholders::_1));
+#endif
bus.attach_event(loop, SD_EVENT_PRIORITY_NORMAL);
auto rc = sd_event_loop(loop);
if (rc < 0)