diff options
author | Joseph Reynolds <jrey@us.ibm.com> | 2018-05-30 11:16:03 -0500 |
---|---|---|
committer | Joseph Reynolds <jrey@us.ibm.com> | 2018-05-31 14:19:14 -0500 |
commit | afd0a45c9771d640f7f8596b8d305dff2bbf98cf (patch) | |
tree | ed550499f958ffb85ca56cf24c63a1787f67648c | |
parent | a98ff8d946cc140e4424b193fd2189529da3102a (diff) | |
download | openpower-pnor-code-mgmt-afd0a45c9771d640f7f8596b8d305dff2bbf98cf.tar.gz openpower-pnor-code-mgmt-afd0a45c9771d640f7f8596b8d305dff2bbf98cf.zip |
Use s.c_str() in log messages
Part of a series of commits that resolve openbmc 2905
Here is something funny: in item_updater.cpp:300 is a string
and on line 316 it is const char*. It may be confusing to
have the same variable name with two different related types.
Tested: static_assert only
Change-Id: I59556fc184ef1f1047bd8a76062598b7518c36ae
Signed-off-by: Joseph Reynolds <jrey@us.ibm.com>
-rwxr-xr-x | activation.cpp | 6 | ||||
-rw-r--r-- | item_updater.cpp | 14 |
2 files changed, 10 insertions, 10 deletions
diff --git a/activation.cpp b/activation.cpp index 87e5d2bd1..11c7b3254 100755 --- a/activation.cpp +++ b/activation.cpp @@ -205,7 +205,7 @@ void Activation::deleteImageManagerObject() if (mapperResponseMsg.is_method_error()) { log<level::ERR>("Error in Get Delete Object", - entry("VERSIONPATH=%s", path)); + entry("VERSIONPATH=%s", path.c_str())); return; } std::map<std::string, std::vector<std::string>> mapperResponse; @@ -213,7 +213,7 @@ void Activation::deleteImageManagerObject() if (mapperResponse.begin() == mapperResponse.end()) { log<level::ERR>("ERROR in reading the mapper response", - entry("VERSIONPATH=%s", path)); + entry("VERSIONPATH=%s", path.c_str())); return; } @@ -227,7 +227,7 @@ void Activation::deleteImageManagerObject() if (mapperResponseMsg.is_method_error()) { log<level::ERR>("Error in Deleting image from image manager", - entry("VERSIONPATH=%s", path)); + entry("VERSIONPATH=%s", path.c_str())); return; } } diff --git a/item_updater.cpp b/item_updater.cpp index ad8f26474..a3b1c9cd0 100644 --- a/item_updater.cpp +++ b/item_updater.cpp @@ -94,7 +94,7 @@ void ItemUpdater::createActivation(sdbusplus::message::message& m) if (pos == std::string::npos) { log<level::ERR>("No version id found in object path", - entry("OBJPATH=%s", path)); + entry("OBJPATH=%s", path.c_str())); return; } @@ -160,7 +160,7 @@ void ItemUpdater::processPNORImage() if (!fs::is_regular_file(pnorTOC)) { log<level::ERR>("Failed to read pnorTOC.", - entry("FILENAME=%s", pnorTOC.string())); + entry("FILENAME=%s", pnorTOC.c_str())); ItemUpdater::erase(id); continue; } @@ -170,7 +170,7 @@ void ItemUpdater::processPNORImage() if (version.empty()) { log<level::ERR>("Failed to read version from pnorTOC", - entry("FILENAME=%s", pnorTOC.string())); + entry("FILENAME=%s", pnorTOC.c_str())); activationState = server::Activation::Activations::Invalid; } @@ -178,7 +178,7 @@ void ItemUpdater::processPNORImage() if (extendedVersion.empty()) { log<level::ERR>("Failed to read extendedVersion from pnorTOC", - entry("FILENAME=%s", pnorTOC.string())); + entry("FILENAME=%s", pnorTOC.c_str())); activationState = server::Activation::Activations::Invalid; } @@ -210,7 +210,7 @@ void ItemUpdater::processPNORImage() if (!restoreFromFile(id, priority)) { log<level::ERR>("Unable to restore priority from file.", - entry("VERSIONID=%s", id)); + entry("VERSIONID=%s", id.c_str())); } activations.find(id)->second->redundancyPriority = std::make_unique<RedundancyPriority>( @@ -233,7 +233,7 @@ void ItemUpdater::processPNORImage() if (!fs::is_directory(roDir)) { log<level::ERR>("No corresponding read-only volume found.", - entry("DIRNAME=%s", roDir)); + entry("DIRNAME=%s", roDir.c_str())); ItemUpdater::erase(id); } } @@ -309,7 +309,7 @@ void ItemUpdater::reset() if (reply.is_method_error()) { log<level::ERR>("Failed to clear read-write partitions", - entry("SERVICE_FILE=%s", serviceFile)); + entry("SERVICE_FILE=%s", serviceFile.c_str())); elog<InternalFailure>(); } } |