summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-07-23 16:59:55 +0200
committerLennart Poettering <lennart@poettering.net>2008-07-23 16:59:55 +0200
commit32e93d5c898e63007da3d9adcbab0cfd70f99a09 (patch)
treefaa7766abb9f2f7de25f2303ff6589d09c1c6826
parentc415479a5518c93956213d4260b5c412e3927f2f (diff)
follow consolekit's recent D-Bus API change, original patch from William Jon McCan
-rw-r--r--src/modules/module-console-kit.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/modules/module-console-kit.c b/src/modules/module-console-kit.c
index 3adee99e..5a3975fb 100644
--- a/src/modules/module-console-kit.c
+++ b/src/modules/module-console-kit.c
@@ -71,7 +71,7 @@ struct userdata {
static void add_session(struct userdata *u, const char *id) {
DBusError error;
DBusMessage *m = NULL, *reply = NULL;
- int32_t uid;
+ uint32_t uid;
struct session *session;
char *t;
@@ -92,10 +92,12 @@ static void add_session(struct userdata *u, const char *id) {
goto fail;
}
- /* FIXME: Why is this in int32? and not an uint32? */
- if (!dbus_message_get_args(reply, &error, DBUS_TYPE_INT32, &uid, DBUS_TYPE_INVALID)) {
- pa_log("Failed to parse GetUnixUser() result: %s: %s", error.name, error.message);
- goto fail;
+ /* CK 0.3 this changed from int32 to uint32 */
+ if (!dbus_message_get_args(reply, &error, DBUS_TYPE_UINT32, &uid, DBUS_TYPE_INVALID)) {
+ if (!dbus_message_get_args(reply, &error, DBUS_TYPE_INT32, &uid, DBUS_TYPE_INVALID)) {
+ pa_log("Failed to parse GetUnixUser() result: %s: %s", error.name, error.message);
+ goto fail;
+ }
}
/* We only care about our own sessions */
@@ -163,18 +165,24 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *message, vo
if (dbus_message_is_signal(message, "org.freedesktop.ConsoleKit.Seat", "SessionAdded")) {
- if (!dbus_message_get_args(message, &error, DBUS_TYPE_STRING, &path, DBUS_TYPE_INVALID) || dbus_error_is_set(&error)) {
- pa_log_error("Failed to parse SessionAdded message: %s: %s", error.name, error.message);
- goto finish;
+ /* CK API changed to match spec in 0.3 */
+ if (!dbus_message_get_args(message, &error, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)) {
+ if (!dbus_message_get_args(message, &error, DBUS_TYPE_STRING, &path, DBUS_TYPE_INVALID)) {
+ pa_log_error("Failed to parse SessionAdded message: %s: %s", error.name, error.message);
+ goto finish;
+ }
}
add_session(u, path);
} else if (dbus_message_is_signal(message, "org.freedesktop.ConsoleKit.Seat", "SessionRemoved")) {
- if (!dbus_message_get_args(message, &error, DBUS_TYPE_STRING, &path, DBUS_TYPE_INVALID) || dbus_error_is_set(&error)) {
- pa_log_error("Failed to parse SessionRemoved message: %s: %s", error.name, error.message);
- goto finish;
+ /* CK API changed to match spec in 0.3 */
+ if (!dbus_message_get_args(message, &error, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)) {
+ if (!dbus_message_get_args(message, &error, DBUS_TYPE_STRING, &path, DBUS_TYPE_INVALID)) {
+ pa_log_error("Failed to parse SessionRemoved message: %s: %s", error.name, error.message);
+ goto finish;
+ }
}
remove_session(u, path);