libinput_dispatch: return negative error number on failure

Might as well tell the caller what went wrong without having to worry about
errno.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2013-12-05 17:26:40 +10:00
parent 2aec703c2e
commit f583cb7f6c

View file

@ -22,6 +22,7 @@
#include "config.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -212,7 +213,7 @@ libinput_dispatch(struct libinput *libinput)
count = epoll_wait(libinput->epoll_fd, ep, ARRAY_LENGTH(ep), 0);
if (count < 0)
return -1;
return -errno;
for (i = 0; i < count; ++i) {
source = ep[i].data.ptr;