From 9bcbce4201afada1c0ad8ada0cbfbbf58a52a6a7 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Tue, 22 Oct 2013 03:27:38 +0200 Subject: 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. --- src/hostname/hostnamed.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/hostname') diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c index db0762140b..0854bc412f 100644 --- a/src/hostname/hostnamed.c +++ b/src/hostname/hostnamed.c @@ -371,7 +371,7 @@ static int method_set_hostname(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 *name; - bool interactive; + unsigned interactive; char *h; int r; @@ -421,7 +421,7 @@ static int method_set_static_hostname(sd_bus *bus, sd_bus_message *m, void *user _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; Context *c = userdata; const char *name; - bool interactive; + unsigned interactive; int r; r = sd_bus_message_read(m, "sb", &name, &interactive); @@ -472,7 +472,7 @@ static int method_set_static_hostname(sd_bus *bus, sd_bus_message *m, void *user static int set_machine_info(Context *c, sd_bus *bus, sd_bus_message *m, int prop, sd_bus_message_handler_t cb) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - bool interactive; + unsigned interactive; const char *name; int r; -- cgit v1.2.3-54-g00ecf