From: David Herrmann Date: Tue, 1 Oct 2013 15:48:15 +0000 (+0200) Subject: logind: fix session-device dbus notify X-Git-Tag: v208~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=081dfa852fc5cd183a20747f2d8e4ef62d29d181;p=platform%2Fupstream%2Fsystemd.git logind: fix session-device dbus notify Had this fix lying around here for some time. Thanks to missing type-checking for va-args we passed in the actual major/minor values instead of pointers to it. Fix it by saving the values on the stack first and passing in the pointers. --- diff --git a/src/login/logind-session-device.c b/src/login/logind-session-device.c index b45f9eb..27afafa 100644 --- a/src/login/logind-session-device.c +++ b/src/login/logind-session-device.c @@ -46,9 +46,13 @@ static void session_device_notify(SessionDevice *sd, enum SessionDeviceNotificat _cleanup_dbus_message_unref_ DBusMessage *m = NULL; _cleanup_free_ char *path = NULL; const char *t = NULL; + uint32_t major, minor; assert(sd); + major = major(sd->dev); + minor = minor(sd->dev); + if (!sd->session->controller) return; @@ -68,8 +72,8 @@ static void session_device_notify(SessionDevice *sd, enum SessionDeviceNotificat switch (type) { case SESSION_DEVICE_RESUME: if (!dbus_message_append_args(m, - DBUS_TYPE_UINT32, major(sd->dev), - DBUS_TYPE_UINT32, minor(sd->dev), + DBUS_TYPE_UINT32, &major, + DBUS_TYPE_UINT32, &minor, DBUS_TYPE_UNIX_FD, &sd->fd, DBUS_TYPE_INVALID)) return; @@ -88,8 +92,8 @@ static void session_device_notify(SessionDevice *sd, enum SessionDeviceNotificat } if (t && !dbus_message_append_args(m, - DBUS_TYPE_UINT32, major(sd->dev), - DBUS_TYPE_UINT32, minor(sd->dev), + DBUS_TYPE_UINT32, &major, + DBUS_TYPE_UINT32, &minor, DBUS_TYPE_STRING, &t, DBUS_TYPE_INVALID)) return;