summaryrefslogtreecommitdiff
path: root/src/shared/bus-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-08-17 19:00:12 +0200
committerLennart Poettering <lennart@poettering.net>2016-08-22 16:14:21 +0200
commitbdf97b8ad84a66e0687222ac139603468162d785 (patch)
treefb390eef26c516a05ea13b20f9627801c2696b53 /src/shared/bus-util.c
parent05a98afd3e0513de50c5949b7fa50ff0989d68bc (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/bus-util.c')
-rw-r--r--src/shared/bus-util.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
index 52410999cf..b7dda3ee4d 100644
--- a/src/shared/bus-util.c
+++ b/src/shared/bus-util.c
@@ -1059,29 +1059,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;
}