diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-08-17 19:00:12 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-07-05 08:50:51 +0200 |
commit | afc4586231642a2f611fc6e0bdc29318da8a165b (patch) | |
tree | 1fe0f04e75a0f8f7b24d4459ba69463d0cbaebcd /src/shared | |
parent | 682a7fe521cc3d983dc6c690cbc107a3c8a13344 (diff) |
bus-util: support mapping signed integers with bus_map_properties()
Let's make sure we can read the exit code/status properties exposed by PID 1
properly. Let's reuse the existing code for unsigned fields, as we just use it
to copy words around, and don't calculate it.
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/bus-util.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index 5ea4e5608..2af4dde34 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -1063,29 +1063,27 @@ static int map_basic(sd_bus *bus, const char *member, sd_bus_message *m, sd_bus_ break; } + case SD_BUS_TYPE_INT32: case SD_BUS_TYPE_UINT32: { - uint32_t u; - uint32_t *p = userdata; + uint32_t u, *p = userdata; r = sd_bus_message_read_basic(m, type, &u); if (r < 0) break; *p = u; - break; } + case SD_BUS_TYPE_INT64: case SD_BUS_TYPE_UINT64: { - uint64_t t; - uint64_t *p = userdata; + uint64_t t, *p = userdata; r = sd_bus_message_read_basic(m, type, &t); if (r < 0) break; *p = t; - break; } |