[systemd-commits] src/hostname src/libsystemd-bus src/locale src/timedate
Kay Sievers
kay at kemper.freedesktop.org
Thu Nov 7 02:06:32 CET 2013
src/hostname/hostnamed.c | 6 +++---
src/libsystemd-bus/bus-message.c | 2 +-
src/libsystemd-bus/bus-util.c | 4 ++--
src/locale/localed.c | 4 ++--
src/timedate/timedated.c | 10 +++++-----
5 files changed, 13 insertions(+), 13 deletions(-)
New commits:
commit 102d8f8169427cb68cdebf5ee0f0e07788e9c2b2
Author: Kay Sievers <kay at vrfy.org>
Date: Thu Nov 7 02:03:10 2013 +0100
consistently use "int" when retrieving "bool" from bus messages
diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c
index 0854bc4..35dccf8 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;
- unsigned interactive;
+ int 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;
- unsigned interactive;
+ int 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;
- unsigned interactive;
+ int interactive;
const char *name;
int r;
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c
index 67f7d58..9543ae3 100644
--- a/src/libsystemd-bus/bus-message.c
+++ b/src/libsystemd-bus/bus-message.c
@@ -2669,7 +2669,7 @@ _public_ int sd_bus_message_read_basic(sd_bus_message *m, char type, void *p) {
case SD_BUS_TYPE_BOOLEAN:
if (p)
- *(unsigned*) p = !!*(uint32_t*) q;
+ *(int*) p = !!*(uint32_t*) q;
break;
case SD_BUS_TYPE_INT16:
diff --git a/src/libsystemd-bus/bus-util.c b/src/libsystemd-bus/bus-util.c
index 3bb1fb7..13ad444 100644
--- a/src/libsystemd-bus/bus-util.c
+++ b/src/libsystemd-bus/bus-util.c
@@ -151,7 +151,7 @@ int bus_verify_polkit(
#ifdef ENABLE_POLKIT
else {
_cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
- unsigned authorized = false, challenge = false;
+ int authorized = false, challenge = false;
r = sd_bus_call_method(
bus,
@@ -270,7 +270,7 @@ int bus_verify_polkit_async(
#ifdef ENABLE_POLKIT
q = hashmap_remove(*registry, m);
if (q) {
- unsigned authorized, challenge;
+ int authorized, challenge;
/* This is the second invocation of this function, and
* there's already a response from polkit, let's
diff --git a/src/locale/localed.c b/src/locale/localed.c
index 61a3015..744d304 100644
--- a/src/locale/localed.c
+++ b/src/locale/localed.c
@@ -908,7 +908,7 @@ static int method_set_vc_keyboard(sd_bus *bus, sd_bus_message *m, void *userdata
Context *c = userdata;
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
const char *keymap, *keymap_toggle;
- unsigned convert, interactive;
+ int convert, interactive;
int r;
r = sd_bus_message_read(m, "ssbb", &keymap, &keymap_toggle, &convert, &interactive);
@@ -971,7 +971,7 @@ static int method_set_x11_keyboard(sd_bus *bus, sd_bus_message *m, void *userdat
Context *c = userdata;
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
const char *layout, *model, *variant, *options;
- unsigned convert, interactive;
+ int convert, interactive;
int r;
r = sd_bus_message_read(m, "ssssbb", &layout, &model, &variant, &options, &convert, &interactive);
diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
index f5d2201..163b276 100644
--- a/src/timedate/timedated.c
+++ b/src/timedate/timedated.c
@@ -523,7 +523,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;
- unsigned interactive;
+ int interactive;
char *t;
int r;
@@ -587,7 +587,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;
- unsigned lrtc, fix_system, interactive;
+ int lrtc, fix_system, interactive;
Context *c = userdata;
struct timespec ts;
int r;
@@ -671,7 +671,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;
- unsigned relative, interactive;
+ int relative, interactive;
Context *c = userdata;
int64_t utc;
struct timespec ts;
@@ -737,7 +737,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;
- unsigned ntp, interactive;
+ int ntp, interactive;
Context *c = userdata;
int r;
@@ -745,7 +745,7 @@ static int method_set_ntp(sd_bus *bus, sd_bus_message *m, void *userdata) {
if (r < 0)
return sd_bus_reply_method_errno(bus, m, r, NULL);
- if (ntp == c->use_ntp)
+ if ((bool)ntp == c->use_ntp)
return sd_bus_reply_method_return(bus, m, NULL);
r = bus_verify_polkit_async(bus, &c->polkit_registry, m, "org.freedesktop.timedate1.set-ntp", interactive, &error, method_set_ntp, c);
More information about the systemd-commits
mailing list