From: Hans de Goede Date: Wed, 12 Mar 2014 11:45:40 +0000 (+0100) Subject: systemd_logind_find_info_ptr_by_devnum: Add a start argument X-Git-Tag: upstream/1.15.99.902~54^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ddc3888bbaaddc47706a9cb96459738683d72cb3;p=platform%2Fupstream%2Fxorg-server.git 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 Reviewed-by: Peter Hutterer --- 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);