From 153d8d0a5ad6bf2379bd03df6307029180bac0ab Mon Sep 17 00:00:00 2001 From: Niclas Zeising Date: Thu, 13 Aug 2020 11:59:20 +0200 Subject: [PATCH] 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 --- libevdev/libevdev-uinput.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libevdev/libevdev-uinput.c b/libevdev/libevdev-uinput.c index 24332f5..7bbff44 100644 --- a/libevdev/libevdev-uinput.c +++ b/libevdev/libevdev-uinput.c @@ -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 -- 2.34.1