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>
diff --git a/item_updater.cpp b/item_updater.cpp
index df53747..e4c9e9c 100644
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -96,7 +96,7 @@
     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;
     }
 
@@ -171,7 +171,7 @@
             if (!fs::is_regular_file(osRelease))
             {
                 log<level::ERR>("Failed to read osRelease",
-                                entry("FILENAME=%s", osRelease.string()));
+                                entry("FILENAME=%s", osRelease.string().c_str()));
                 ItemUpdater::erase(id);
                 continue;
             }
@@ -179,7 +179,7 @@
             if (version.empty())
             {
                 log<level::ERR>("Failed to read version from osRelease",
-                                entry("FILENAME=%s", osRelease.string()));
+                                entry("FILENAME=%s", osRelease.string().c_str()));
                 activationState = server::Activation::Activations::Invalid;
             }
 
@@ -251,7 +251,7 @@
                     else
                     {
                         log<level::ERR>("Unable to restore priority from file.",
-                                entry("VERSIONID=%s", id));
+                                entry("VERSIONID=%s", id.c_str()));
                     }
                 }
                 activations.find(id)->second->redundancyPriority =
@@ -629,7 +629,7 @@
     if (result.is_method_error())
     {
         log<level::ERR>("Failed to update u-boot env variables",
-                        entry("VERSIONID=%s", versionId));
+                        entry("VERSIONID=%s", versionId.c_str()));
     }
 }