mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-21 21:20:06 +01:00
uinput: Move SYS_INPUT_DIR to where it is used
Move the definition of SYS_INPUT_DIR to where it is used, instead of at the top of the file, to make it easier to find. Undefine it at the end of usage to avoid accidental uses. Signed-off-by: Niclas Zeising <zeising@daemonic.se>
This commit is contained in:
parent
1bf2b41d3f
commit
153d8d0a5a
1 changed files with 2 additions and 2 deletions
|
|
@ -38,8 +38,6 @@
|
||||||
#include "libevdev-uinput-int.h"
|
#include "libevdev-uinput-int.h"
|
||||||
#include "libevdev-util.h"
|
#include "libevdev-util.h"
|
||||||
|
|
||||||
#define SYS_INPUT_DIR "/sys/devices/virtual/input/"
|
|
||||||
|
|
||||||
#ifndef UINPUT_IOCTL_BASE
|
#ifndef UINPUT_IOCTL_BASE
|
||||||
#define UINPUT_IOCTL_BASE 'U'
|
#define UINPUT_IOCTL_BASE 'U'
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -217,6 +215,7 @@ static int is_input_device(const struct dirent *dent) {
|
||||||
static int
|
static int
|
||||||
fetch_syspath_and_devnode(struct libevdev_uinput *uinput_dev)
|
fetch_syspath_and_devnode(struct libevdev_uinput *uinput_dev)
|
||||||
{
|
{
|
||||||
|
#define SYS_INPUT_DIR "/sys/devices/virtual/input/"
|
||||||
struct dirent **namelist;
|
struct dirent **namelist;
|
||||||
int ndev, i;
|
int ndev, i;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
@ -290,6 +289,7 @@ fetch_syspath_and_devnode(struct libevdev_uinput *uinput_dev)
|
||||||
free(namelist);
|
free(namelist);
|
||||||
|
|
||||||
return uinput_dev->devnode ? 0 : -1;
|
return uinput_dev->devnode ? 0 : -1;
|
||||||
|
#undef SYS_INPUT_DIR
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue