summaryrefslogtreecommitdiffstats
path: root/watch.cpp
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2018-02-13 14:48:53 -0600
committerAdriana Kobylak <anoo@us.ibm.com>2018-02-13 15:41:27 -0600
commit596466b809154900dd12680724bd8827d9e7963c (patch)
tree7316a571305c36277944b8f22a4e591dfc94add0 /watch.cpp
parent2b2cd9f74e8e0158f93e3d4bb77346616c889698 (diff)
downloadphosphor-bmc-code-mgmt-596466b809154900dd12680724bd8827d9e7963c.tar.gz
phosphor-bmc-code-mgmt-596466b809154900dd12680724bd8827d9e7963c.zip
Fix error logging
- The logging interfaces don't support std::string, so need to pass c-strings to the metadata fields, or the pointer address will be the one added to the log. - Log the name of the file uploaded to the BMC instead of the manifest path when there is a manifest error. The manifest path is always /tmp/imgXXXX/MANIFEST which doesn't help debug. - Check the status of the child process after waitpid returns. The execl call returns when there was an error executing execl, not if the command executed failed. This will catch when tar returns a non-0 return code. Change-Id: Ia4bd2666fc6beec28dee7e821d959a336800d282 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Diffstat (limited to 'watch.cpp')
-rw-r--r--watch.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/watch.cpp b/watch.cpp
index c3aa7e9..c7c3653 100644
--- a/watch.cpp
+++ b/watch.cpp
@@ -104,7 +104,7 @@ int Watch::callback(sd_event_source* s,
if (rc < 0)
{
log<level::ERR>("Error processing image",
- entry("IMAGE=%s", tarballPath));
+ entry("IMAGE=%s", tarballPath.c_str()));
}
}
OpenPOWER on IntegriCloud