mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-20 13:50:16 +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-util.h"
|
||||
|
||||
#define SYS_INPUT_DIR "/sys/devices/virtual/input/"
|
||||
|
||||
#ifndef UINPUT_IOCTL_BASE
|
||||
#define UINPUT_IOCTL_BASE 'U'
|
||||
#endif
|
||||
|
|
@ -217,6 +215,7 @@ static int is_input_device(const struct dirent *dent) {
|
|||
static int
|
||||
fetch_syspath_and_devnode(struct libevdev_uinput *uinput_dev)
|
||||
{
|
||||
#define SYS_INPUT_DIR "/sys/devices/virtual/input/"
|
||||
struct dirent **namelist;
|
||||
int ndev, i;
|
||||
int rc;
|
||||
|
|
@ -290,6 +289,7 @@ fetch_syspath_and_devnode(struct libevdev_uinput *uinput_dev)
|
|||
free(namelist);
|
||||
|
||||
return uinput_dev->devnode ? 0 : -1;
|
||||
#undef SYS_INPUT_DIR
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue