PEL: Fix for error - unable to read PEL ID file
This is a case when PEL daemon can't read pelID file to get the next
pel Id to use. It could be that the file got corrupted during code
update or factory reset leading to zeros data in file. The fix is to
delete the file as there is already code later to recreate file if
not available.
Signed-off-by: Sumit Kumar <sumit_kumar@in.ibm.com>
Change-Id: I42372cc1d79ece5914e7fdb51f3fa2a2d9cb07e7
diff --git a/extensions/openpower-pels/log_id.hpp b/extensions/openpower-pels/log_id.hpp
index 21f04eb..7318711 100644
--- a/extensions/openpower-pels/log_id.hpp
+++ b/extensions/openpower-pels/log_id.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <cstdint>
+#include <string>
namespace openpower
{
@@ -43,5 +44,11 @@
*/
uint32_t generatePELID();
+/**
+ * @brief Check for file containing zero data.
+ *
+ */
+void checkFileForZeroData(const std::string& filename);
+
} // namespace pels
} // namespace openpower