From 12cb84add1378bbd99e01bdc1de0ab4098945343 Mon Sep 17 00:00:00 2001 From: Michal Minar Date: Mon, 30 Jun 2014 10:30:11 +0200 Subject: providers: logging fixes Fixes logging of messages taking CMPIStatus::msg as an argument. *msg* needs to be wrapped in CMGetCharsPtr(). --- src/libs/jobmanager/job_manager.c | 8 ++++---- src/software-dbus/LMI_SoftwareInstallationJobProvider.c | 4 ++-- src/software-dbus/sw-utils.c | 2 -- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/libs/jobmanager/job_manager.c b/src/libs/jobmanager/job_manager.c index d2869b2..bc654d7 100644 --- a/src/libs/jobmanager/job_manager.c +++ b/src/libs/jobmanager/job_manager.c @@ -1043,7 +1043,7 @@ static CMPIStatus delete_job(LmiJob *job) { if (status.msg) { lmi_error("Failed to create instance deletion indication: %s", - status.msg); + CMGetCharsPtr(status.msg, NULL)); } else { lmi_error("Failed to create instance deletion indication!"); } @@ -1060,7 +1060,7 @@ static CMPIStatus delete_job(LmiJob *job) { if (status.msg) { lmi_error("Failed to send instance deletion indication: %s", - status.msg); + CMGetCharsPtr(status.msg, NULL)); } else { lmi_error("Failed to send instance deletion indication!"); } @@ -1502,7 +1502,7 @@ static gboolean register_job(LmiJob *job, gboolean is_new) { if (status.msg) { lmi_error("Failed to create instance creation indication: %s", - status.msg); + CMGetCharsPtr(status.msg, NULL)); } else { lmi_error("Failed to create instance creation indication!"); } @@ -1511,7 +1511,7 @@ static gboolean register_job(LmiJob *job, gboolean is_new) { if (status.msg) { lmi_error("Failed to send instance creation indication: %s", - status.msg); + CMGetCharsPtr(status.msg, NULL)); } else { lmi_error("Failed to send instance creation indication!"); } diff --git a/src/software-dbus/LMI_SoftwareInstallationJobProvider.c b/src/software-dbus/LMI_SoftwareInstallationJobProvider.c index 47f4c82..f0b7327 100644 --- a/src/software-dbus/LMI_SoftwareInstallationJobProvider.c +++ b/src/software-dbus/LMI_SoftwareInstallationJobProvider.c @@ -92,7 +92,7 @@ static CMPIStatus LMI_SoftwareInstallationJobEnumInstances( if (status.msg) { jobid = lmi_job_get_jobid(job); lmi_warn("Failed to make cim instance out of job \"%s\": %s", - jobid, status.msg); + jobid, CMGetCharsPtr(status.msg, NULL)); g_free(jobid); continue; } @@ -129,7 +129,7 @@ static CMPIStatus LMI_SoftwareInstallationJobGetInstance( if (status.msg) { jobid = lmi_job_get_jobid(job); lmi_warn("Failed to make cim instance out of job \"%s\": %s", - jobid, status.msg); + jobid, CMGetCharsPtr(status.msg, NULL)); g_free(jobid); return status; } diff --git a/src/software-dbus/sw-utils.c b/src/software-dbus/sw-utils.c index 6922015..382ce72 100644 --- a/src/software-dbus/sw-utils.c +++ b/src/software-dbus/sw-utils.c @@ -884,8 +884,6 @@ done: if (task) { g_object_unref(task); } - - return status; } void get_repo_id_from_sw_pkg(const SwPackage *sw_pkg, gchar **repo_id_p, -- cgit