summaryrefslogtreecommitdiff
path: root/src/timedate
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-10-22 03:27:38 +0200
committerKay Sievers <kay@vrfy.org>2013-10-22 03:35:45 +0200
commit9bcbce4201afada1c0ad8ada0cbfbbf58a52a6a7 (patch)
tree6711cfcec9e2d25dae74a3d04e9093e2cdfdcec0 /src/timedate
parent40976028c6f24b9934e6c797ef6f5e123ac520d5 (diff)
bus: avoid 'bool' storage when retrieving 'b' from the message
Just use an unsigned int as a bool type to avoid issues in the public message reading API; sizeof(bool) == 1, but the code copies 4 bytes at the pointers destination.
Diffstat (limited to 'src/timedate')
-rw-r--r--src/timedate/timedated.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
index 2ead4b9999..809c80bad1 100644
--- a/src/timedate/timedated.c
+++ b/src/timedate/timedated.c
@@ -45,8 +45,8 @@
typedef struct Context {
char *zone;
bool local_rtc;
- int can_ntp;
- int use_ntp;
+ unsigned can_ntp;
+ unsigned use_ntp;
Hashmap *polkit_registry;
} Context;
@@ -521,7 +521,7 @@ static int method_set_timezone(sd_bus *bus, sd_bus_message *m, void *userdata) {
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
Context *c = userdata;
const char *z;
- bool interactive;
+ unsigned interactive;
char *t;
int r;
@@ -585,7 +585,7 @@ static int method_set_timezone(sd_bus *bus, sd_bus_message *m, void *userdata) {
static int method_set_local_rtc(sd_bus *bus, sd_bus_message *m, void *userdata) {
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
- bool lrtc, fix_system, interactive;
+ unsigned lrtc, fix_system, interactive;
Context *c = userdata;
struct timespec ts;
int r;
@@ -669,7 +669,7 @@ static int method_set_local_rtc(sd_bus *bus, sd_bus_message *m, void *userdata)
static int method_set_time(sd_bus *bus, sd_bus_message *m, void *userdata) {
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
- bool relative, interactive;
+ unsigned relative, interactive;
Context *c = userdata;
int64_t utc;
struct timespec ts;
@@ -735,7 +735,7 @@ static int method_set_time(sd_bus *bus, sd_bus_message *m, void *userdata) {
static int method_set_ntp(sd_bus *bus, sd_bus_message *m, void *userdata) {
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
- bool ntp, interactive;
+ unsigned ntp, interactive;
Context *c = userdata;
int r;