diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-11-14 13:05:01 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-11-14 13:18:51 +0100 |
commit | 8022212b3b8e553fd83b87575f3e730e56852d5d (patch) | |
tree | a8797b3a9b741c6217a74be35abfb94477531575 /src/libsystemd | |
parent | 34b950a8d8b83b3c101beba479a9ddae8c2ebb93 (diff) |
sd-bus: add sd_bus_message_is_empty() for checking whether a message carries any body
Diffstat (limited to 'src/libsystemd')
-rw-r--r-- | src/libsystemd/libsystemd.sym.m4 | 1 | ||||
-rw-r--r-- | src/libsystemd/sd-bus/bus-message.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/libsystemd/libsystemd.sym.m4 b/src/libsystemd/libsystemd.sym.m4 index 0c02db7530..7632942564 100644 --- a/src/libsystemd/libsystemd.sym.m4 +++ b/src/libsystemd/libsystemd.sym.m4 @@ -254,6 +254,7 @@ global: sd_bus_message_get_realtime_usec; sd_bus_message_get_seqnum; sd_bus_message_get_creds; + sd_bus_message_is_empty; sd_bus_message_is_signal; sd_bus_message_is_method_call; sd_bus_message_is_method_error; diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c index 1a8c445f0b..9d6647b2c4 100644 --- a/src/libsystemd/sd-bus/bus-message.c +++ b/src/libsystemd/sd-bus/bus-message.c @@ -5380,6 +5380,12 @@ _public_ const char* sd_bus_message_get_signature(sd_bus_message *m, int complet return strempty(c->signature); } +_public_ int sd_bus_message_is_empty(sd_bus_message *m) { + assert_return(m, -EINVAL); + + return isempty(m->root_container.signature); +} + _public_ int sd_bus_message_copy(sd_bus_message *m, sd_bus_message *source, int all) { bool done_something = false; int r; |