libinput: Fix the close_restricted interface callback
authorJasper St. Pierre <jstpierre@mecheye.net>
Sat, 1 Mar 2014 19:19:03 +0000 (14:19 -0500)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 4 Mar 2014 05:21:38 +0000 (15:21 +1000)
commit385bfdb762be88abc7089044b4b030026511c1e5
tree6ef66c7538291d0b51683bfa767a8638c9951efb
parent6ae636fe18ed8d26c97a2f9563295ed953e56e31
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>
src/evdev-touchpad.c
src/libinput.c