Create BMC Dump directory if not present
Change-Id: I5e646f06fd35187d60e7bbc37213f935f5084810
Signed-off-by: Swetha Parasa <parasa.swetha1@ibm.com>
Signed-off-by: Gopichand Paturi <gopichandpaturi@gmail.com>
diff --git a/dump_manager_main.cpp b/dump_manager_main.cpp
index a3ce920..b90b45b 100644
--- a/dump_manager_main.cpp
+++ b/dump_manager_main.cpp
@@ -62,6 +62,17 @@
try
{
+ try
+ {
+ // Create BMC Dump Directory if not present
+ std::filesystem::create_directories(BMC_DUMP_PATH);
+ }
+ catch (std::exception& e)
+ {
+ lg2::error("Failed to create BMC dump directory {PATH}", "PATH",
+ std::string(BMC_DUMP_PATH));
+ elog<InternalFailure>();
+ }
phosphor::dump::DumpManagerList dumpMgrList{};
std::unique_ptr<phosphor::dump::bmc::Manager> bmcDumpMgr =
std::make_unique<phosphor::dump::bmc::Manager>(