systemd_logind_find_info_ptr_by_devnum: Move to higher inside the file
This is a preparation patch for adding support for server managed fds for InputDevices where multiple input devices share the same device node (and thus also their major and minor). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
ddc3888bba
commit
4e3d9690e1
|
@ -51,6 +51,20 @@ struct systemd_logind_info {
|
||||||
|
|
||||||
static struct systemd_logind_info logind_info;
|
static struct systemd_logind_info logind_info;
|
||||||
|
|
||||||
|
static InputInfoPtr
|
||||||
|
systemd_logind_find_info_ptr_by_devnum(InputInfoPtr start,
|
||||||
|
int major, int minor)
|
||||||
|
{
|
||||||
|
InputInfoPtr pInfo;
|
||||||
|
|
||||||
|
for (pInfo = start; pInfo; pInfo = pInfo->next)
|
||||||
|
if (pInfo->major == major && pInfo->minor == minor &&
|
||||||
|
(pInfo->flags & XI86_SERVER_FD))
|
||||||
|
return pInfo;
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
systemd_logind_take_fd(int _major, int _minor, const char *path,
|
systemd_logind_take_fd(int _major, int _minor, const char *path,
|
||||||
Bool *paused_ret)
|
Bool *paused_ret)
|
||||||
|
@ -203,20 +217,6 @@ systemd_logind_vtenter(void)
|
||||||
xf86InputEnableVTProbe();
|
xf86InputEnableVTProbe();
|
||||||
}
|
}
|
||||||
|
|
||||||
static InputInfoPtr
|
|
||||||
systemd_logind_find_info_ptr_by_devnum(InputInfoPtr start,
|
|
||||||
int major, int minor)
|
|
||||||
{
|
|
||||||
InputInfoPtr pInfo;
|
|
||||||
|
|
||||||
for (pInfo = start; pInfo; pInfo = pInfo->next)
|
|
||||||
if (pInfo->major == major && pInfo->minor == minor &&
|
|
||||||
(pInfo->flags & XI86_SERVER_FD))
|
|
||||||
return pInfo;
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
systemd_logind_ack_pause(struct systemd_logind_info *info,
|
systemd_logind_ack_pause(struct systemd_logind_info *info,
|
||||||
dbus_int32_t minor, dbus_int32_t major)
|
dbus_int32_t minor, dbus_int32_t major)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user