libinput: Fix the close_restricted interface callback

libinput is supposed to take a close callback in its interface
to allow you to call out to a privileged API to close FDs. But
the FD that libinput passes you is bogus, because
libinput_remove_source closes the FD on which it's passed. This
is really bad, as the libinput_source really doesn't own the FD
which it's passed, so it shouldn't be trying to close() it.

Only one out of the four users of libinput_remove_source actually
wants their FD closed, so move the close() call there.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
tools: drop CLOCK_MONOTONIC call, no longer necessary

Obsolete as of 84c4f40f25e91ff6ecd35b47398d13ac3996f101.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Return the length or a neg errno from libinput_device_get_keys()

Previous return value was the straight ioctl, we should try to avoid errno
mangling.

This changes the API, if not the ABI. Callers with code along the lines of
if (libinput_device_get_keys() == -1) will now break.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
udev: factor out device_removed handling

No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Expand documentation for libinput_udev_create_for_seat

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>