summaryrefslogtreecommitdiff
path: root/src/timedate/timedatectl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-06-15 22:41:56 +0200
committerLennart Poettering <lennart@poettering.net>2016-06-21 13:20:48 +0200
commit43dcc86a137b5c1192eca67c345b73a9ccc4dccb (patch)
tree06f58aae378d181bfcb4915c67047eeaf731059f /src/timedate/timedatectl.c
parent943ef07ce0aacbee93c721e461c02d651ee9ef6a (diff)
sd-bus: make sure bus_map_all_properties() handle booleans right
sd-bus generally exposes bools as "int" instead of "bool" in the public API. This is relevant when unmarshaling booleans, as the relevant functions expect an int* pointer and no bool* pointer. Since sizeof(bool) is not necessarily the same as sizeof(int) this is problematic and might result in memory corruption. Let's fix this, and make sure bus_map_all_properties() handles booleans as ints, as the rest of sd-bus, and make all users of it expect the right thing.
Diffstat (limited to 'src/timedate/timedatectl.c')
-rw-r--r--src/timedate/timedatectl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c
index 7f61cf0181..553ef67011 100644
--- a/src/timedate/timedatectl.c
+++ b/src/timedate/timedatectl.c
@@ -57,11 +57,11 @@ typedef struct StatusInfo {
char *timezone;
usec_t rtc_time;
- bool rtc_local;
+ int rtc_local;
- bool ntp_enabled;
- bool ntp_capable;
- bool ntp_synced;
+ int ntp_enabled;
+ int ntp_capable;
+ int ntp_synced;
} StatusInfo;
static void status_info_clear(StatusInfo *info) {