[PATCH 1/5] systemd_logind_find_info_ptr_by_devnum: Add a start argument

Hans de Goede hdegoede at redhat.com
Wed Mar 12 08:08:13 PDT 2014


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 at redhat.com>
---
 hw/xfree86/os-support/linux/systemd-logind.c | 8 +++++---
 1 file 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 a8406d8..09db336 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);
-- 
1.9.0



More information about the xorg-devel mailing list