diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-10-09 03:26:34 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-10-09 03:29:20 +0200 |
commit | 3a7d4f1ba42bddd0cbaa5e0d9482dc5bd30d803f (patch) | |
tree | 3d9550537591e2a4cb2bfe71ca86d448630f89fd /src/libsystemd-bus/bus-message.c | |
parent | 29ddb38fea134c6132e4f2dd608e9da3871eaebe (diff) |
bus: fix synthetic error messages
Diffstat (limited to 'src/libsystemd-bus/bus-message.c')
-rw-r--r-- | src/libsystemd-bus/bus-message.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c index 2cf1a7a538..264a2f63f1 100644 --- a/src/libsystemd-bus/bus-message.c +++ b/src/libsystemd-bus/bus-message.c @@ -682,7 +682,6 @@ fail: return r; } - int bus_message_new_synthetic_error( sd_bus *bus, uint64_t serial, @@ -712,6 +711,16 @@ int bus_message_new_synthetic_error( goto fail; } + r = message_append_field_string(t, SD_BUS_MESSAGE_HEADER_ERROR_NAME, SD_BUS_TYPE_STRING, e->name, &t->error.name); + if (r < 0) + goto fail; + + if (e->message) { + r = message_append_basic(t, SD_BUS_TYPE_STRING, e->message, (const void**) &t->error.message); + if (r < 0) + goto fail; + } + *m = t; return 0; |