(epoll_common.c) Cleanups; don't use verbosity logging inside

This commit is contained in:
twinaphex 2017-06-10 12:07:01 +02:00
parent c70526b7af
commit 84f5fa1f26
3 changed files with 15 additions and 8 deletions

View File

@ -24,8 +24,6 @@
#include "epoll_common.h"
#include "../../verbosity.h"
bool epoll_new(int *epoll_fd)
{
*epoll_fd = epoll_create(32);
@ -52,11 +50,7 @@ bool epoll_add(int *epoll_fd, int fd, void *device)
/* Shouldn't happen, but just check it. */
if (epoll_ctl(*epoll_fd, EPOLL_CTL_ADD, fd, &event) < 0)
{
RARCH_ERR("Failed to add FD (%d) to epoll list (%s).\n",
fd, strerror(errno));
return false;
}
return true;
}

View File

@ -352,7 +352,11 @@ static bool udev_input_add_device(udev_input_t *udev,
tmp[udev->num_devices++] = device;
udev->devices = tmp;
epoll_add(&udev->epfd, fd, device);
if (!epoll_add(&udev->epfd, fd, device))
{
RARCH_ERR("Failed to add FD (%d) to epoll list (%s).\n",
fd, strerror(errno));
}
return true;

View File

@ -107,6 +107,11 @@ static bool linuxraw_joypad_init_pad(const char *path,
if (epoll_add(&linuxraw_epoll, pad->fd, pad))
return true;
else
{
RARCH_ERR("Failed to add FD (%d) to epoll list (%s).\n",
pad->fd, strerror(errno));
}
}
RARCH_ERR("[Device]: Failed to open pad %s (error: %s).\n",
@ -262,7 +267,11 @@ static bool linuxraw_joypad_init(void *data)
{
fcntl(linuxraw_inotify, F_SETFL, fcntl(linuxraw_inotify, F_GETFL) | O_NONBLOCK);
inotify_add_watch(linuxraw_inotify, "/dev/input", IN_DELETE | IN_CREATE | IN_ATTRIB);
epoll_add(&linuxraw_epoll, linuxraw_inotify, NULL);
if (!epoll_add(&linuxraw_epoll, linuxraw_inotify, NULL))
{
RARCH_ERR("Failed to add FD (%d) to epoll list (%s).\n",
linuxraw_inotify, strerror(errno));
}
}
linuxraw_hotplug = true;