(Input drivers) Cleanups
This commit is contained in:
parent
4cfe960bf3
commit
bafda714a1
|
@ -14,15 +14,14 @@
|
|||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../driver.h"
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/kd.h>
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "../../general.h"
|
||||
|
||||
#include "../input_keymaps.h"
|
||||
#include "../input_common.h"
|
||||
#include "../input_joypad.h"
|
||||
|
|
|
@ -273,8 +273,8 @@ static bool add_device(udev_input_t *udev,
|
|||
{
|
||||
int fd;
|
||||
struct input_device **tmp;
|
||||
struct stat st = {0};
|
||||
struct input_device *device = NULL;
|
||||
struct stat st = {0};
|
||||
struct epoll_event event = {0};
|
||||
|
||||
if (stat(devnode, &st) < 0)
|
||||
|
@ -337,8 +337,9 @@ static void udev_input_remove_device(udev_input_t *udev, const char *devnode)
|
|||
|
||||
for (i = 0; i < udev->num_devices; i++)
|
||||
{
|
||||
if (!strcmp(devnode, udev->devices[i]->devnode))
|
||||
{
|
||||
if (strcmp(devnode, udev->devices[i]->devnode) != 0)
|
||||
continue;
|
||||
|
||||
close(udev->devices[i]->fd);
|
||||
free(udev->devices[i]);
|
||||
memmove(udev->devices + i, udev->devices + i + 1,
|
||||
|
@ -346,7 +347,6 @@ static void udev_input_remove_device(udev_input_t *udev, const char *devnode)
|
|||
udev->num_devices--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void udev_input_handle_hotplug(udev_input_t *udev)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue