diff options
author | John Dennis <jdennis@redhat.com> | 2013-04-09 11:19:17 -0400 |
---|---|---|
committer | John Dennis <jdennis@redhat.com> | 2013-04-09 11:19:17 -0400 |
commit | 5a454402113de73e84b007e10f4d51b814675d3e (patch) | |
tree | c4e76a9a4db19bc40db3af7e948540d5658395d3 | |
parent | 42c8a18eb027264a3f3a0e63e51d1fcac35a07b1 (diff) | |
download | realmd-cim-5a454402113de73e84b007e10f4d51b814675d3e.tar.gz realmd-cim-5a454402113de73e84b007e10f4d51b814675d3e.tar.xz realmd-cim-5a454402113de73e84b007e10f4d51b814675d3e.zip |
Remove static buf in rdcp_error_code_to_string(), not thread safe.
Add numeric error code in hangle_g_error() to complement string
representation of error code.
-rw-r--r-- | rdcp_error.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/rdcp_error.c b/rdcp_error.c index f688eaf..c22af53 100644 --- a/rdcp_error.c +++ b/rdcp_error.c @@ -16,16 +16,12 @@ rdcp_error_quark (void) const char * rdcp_error_code_to_string(rdcp_error_codes ec) { - static char buf[80]; - switch(ec) { case RDCP_ERROR_INTERNAL: return "RDCP_ERROR_INTERNAL"; case RDCP_ERROR_INVALID_ARG: return "RDCP_ERROR_INVALID_ARG"; case RDCP_ERROR_INVALID_INSTANCE_ID: return "RDCP_ERROR_INVALID_INSTANCE_ID"; case RDCP_ERROR_DBUS: return "RDCP_ERROR_DBUS"; - default: - snprintf(buf, sizeof(buf), "unknown error code (%d)", ec); - return buf; + default: return "unknown error code"; } } @@ -68,7 +64,9 @@ handle_g_error(GError **g_error, const CMPIBroker* mb, CMPIStatus* st, CMPIrc rc g_string_append(message, ": "); } - g_string_append_printf(message, "(%s) ", rdcp_error_code_to_string((*g_error)->code)); + g_string_append_printf(message, "(%s(%d)) ", + rdcp_error_code_to_string((*g_error)->code), + (*g_error)->code); g_string_append(message, (*g_error)->message); g_error_free(*g_error); *g_error = NULL; |