diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-10-29 21:37:32 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-10-30 02:08:57 +0100 |
commit | 3fc047f43cd4e4a7cc6e7e49e12f1e2fd858b815 (patch) | |
tree | e44432de60b462667b756faad3f62627c977f451 /src | |
parent | dd8243a3bad284e47714a407d7d9cfac7133f7a3 (diff) |
bus: make bus message dump output a bit smaller
Diffstat (limited to 'src')
-rw-r--r-- | src/libsystemd-bus/bus-message.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c index 138d664f3c..bd0079dbb9 100644 --- a/src/libsystemd-bus/bus-message.c +++ b/src/libsystemd-bus/bus-message.c @@ -4047,8 +4047,6 @@ int bus_message_dump(sd_bus_message *m, FILE *f, bool with_header) { "\tsender=%s\n" "\tsignature=%s\n" "\treply_serial=%u\n" - "\terror.name=%s\n" - "\terror.message=%s\n" "\tsealed=%s\n" "\tn_body_parts=%u\n", m, @@ -4067,11 +4065,16 @@ int bus_message_dump(sd_bus_message *m, FILE *f, bool with_header) { strna(m->sender), strna(m->root_container.signature), m->reply_serial, - strna(m->error.name), - strna(m->error.message), yes_no(m->sealed), m->n_body_parts); + if (sd_bus_error_is_set(&m->error)) + fprintf(f, + "\terror.name=%s\n" + "\terror.message=%s\n", + strna(m->error.name), + strna(m->error.message)); + if (m->pid != 0) fprintf(f, "\tpid=%lu\n", (unsigned long) m->pid); if (m->tid != 0) @@ -4113,7 +4116,9 @@ int bus_message_dump(sd_bus_message *m, FILE *f, bool with_header) { if (sd_bus_message_get_audit_sessionid(m, &audit_sessionid) >= 0) fprintf(f, "\taudit_sessionid=%lu\n", (unsigned long) audit_sessionid); - fprintf(f, "\tCAP_KILL=%i\n", sd_bus_message_has_effective_cap(m, 5)); + r = sd_bus_message_has_effective_cap(m, 5); + if (r >= 0) + fprintf(f, "\tCAP_KILL=%s\n", yes_no(r)); if (sd_bus_message_get_cmdline(m, &cmdline) >= 0) { char **c; |