mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
follow consolekit's recent D-Bus API change, original patch from William Jon McCan
This commit is contained in:
parent
c415479a55
commit
32e93d5c89
1 changed files with 19 additions and 11 deletions
|
|
@ -71,7 +71,7 @@ struct userdata {
|
||||||
static void add_session(struct userdata *u, const char *id) {
|
static void add_session(struct userdata *u, const char *id) {
|
||||||
DBusError error;
|
DBusError error;
|
||||||
DBusMessage *m = NULL, *reply = NULL;
|
DBusMessage *m = NULL, *reply = NULL;
|
||||||
int32_t uid;
|
uint32_t uid;
|
||||||
struct session *session;
|
struct session *session;
|
||||||
char *t;
|
char *t;
|
||||||
|
|
||||||
|
|
@ -92,11 +92,13 @@ static void add_session(struct userdata *u, const char *id) {
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: Why is this in int32? and not an uint32? */
|
/* 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)) {
|
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);
|
pa_log("Failed to parse GetUnixUser() result: %s: %s", error.name, error.message);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* We only care about our own sessions */
|
/* We only care about our own sessions */
|
||||||
if ((uid_t) uid != getuid())
|
if ((uid_t) uid != getuid())
|
||||||
|
|
@ -163,19 +165,25 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *message, vo
|
||||||
|
|
||||||
if (dbus_message_is_signal(message, "org.freedesktop.ConsoleKit.Seat", "SessionAdded")) {
|
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)) {
|
/* 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);
|
pa_log_error("Failed to parse SessionAdded message: %s: %s", error.name, error.message);
|
||||||
goto finish;
|
goto finish;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
add_session(u, path);
|
add_session(u, path);
|
||||||
|
|
||||||
} else if (dbus_message_is_signal(message, "org.freedesktop.ConsoleKit.Seat", "SessionRemoved")) {
|
} 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)) {
|
/* 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);
|
pa_log_error("Failed to parse SessionRemoved message: %s: %s", error.name, error.message);
|
||||||
goto finish;
|
goto finish;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
remove_session(u, path);
|
remove_session(u, path);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue