summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-03-12 12:45:40 +0100
committerHans de Goede <hdegoede@redhat.com>2014-03-13 13:11:38 +0100
commitddc3888bbaaddc47706a9cb96459738683d72cb3 (patch)
tree6a91fe8ab6c1128b753385f8afe9fca2963c0a1e
parent40e3c79a591909ab64822cc86fd07513317bf19b (diff)
systemd_logind_find_info_ptr_by_devnum: Add a start argument
Modify systemd_logind_find_info_ptr_by_devnum to take a start argument, so that it can be used to find all occurences of a devnum in an InputInfo list, rather then just the first. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--hw/xfree86/os-support/linux/systemd-logind.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/xfree86/os-support/linux/systemd-logind.c b/hw/xfree86/os-support/linux/systemd-logind.c
index a8406d8be..09db33633 100644
--- a/hw/xfree86/os-support/linux/systemd-logind.c
+++ b/hw/xfree86/os-support/linux/systemd-logind.c
@@ -204,11 +204,12 @@ systemd_logind_vtenter(void)
}
static InputInfoPtr
-systemd_logind_find_info_ptr_by_devnum(int major, int minor)
+systemd_logind_find_info_ptr_by_devnum(InputInfoPtr start,
+ int major, int minor)
{
InputInfoPtr pInfo;
- for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next)
+ for (pInfo = start; pInfo; pInfo = pInfo->next)
if (pInfo->major == major && pInfo->minor == minor &&
(pInfo->flags & XI86_SERVER_FD))
return pInfo;
@@ -320,7 +321,8 @@ message_filter(DBusConnection * connection, DBusMessage * message, void *data)
pdev = xf86_find_platform_device_by_devnum(major, minor);
if (!pdev)
- pInfo = systemd_logind_find_info_ptr_by_devnum(major, minor);
+ pInfo = systemd_logind_find_info_ptr_by_devnum(xf86InputDevs,
+ major, minor);
if (!pdev && !pInfo) {
LogMessage(X_WARNING, "systemd-logind: could not find dev %u:%u\n",
major, minor);