Changeset View
Changeset View
Standalone View
Standalone View
devel/libevdev/files/patch-libevdev_libevdev-uinput.c
Property | Old Value | New Value |
---|---|---|
fbsd:nokeywords | null | yes \ No newline at end of property |
svn:eol-style | null | native \ No newline at end of property |
svn:mime-type | null | text/plain \ No newline at end of property |
--- libevdev/libevdev-uinput.c.orig 2016-04-28 00:40:58 UTC | |||||
+++ libevdev/libevdev-uinput.c | |||||
@@ -182,6 +182,7 @@ libevdev_uinput_get_fd(const struct libe | |||||
return uinput_dev->fd; | |||||
} | |||||
+#if defined(linux) | |||||
static int is_event_device(const struct dirent *dent) { | |||||
return strncmp("event", dent->d_name, 5) == 0; | |||||
} | |||||
@@ -213,10 +214,12 @@ fetch_device_node(const char *path) | |||||
static int is_input_device(const struct dirent *dent) { | |||||
return strncmp("input", dent->d_name, 5) == 0; | |||||
} | |||||
+#endif | |||||
static int | |||||
fetch_syspath_and_devnode(struct libevdev_uinput *uinput_dev) | |||||
{ | |||||
+#if defined(linux) | |||||
struct dirent **namelist; | |||||
int ndev, i; | |||||
int rc; | |||||
@@ -290,6 +293,16 @@ fetch_syspath_and_devnode(struct libevde | |||||
free(namelist); | |||||
return uinput_dev->devnode ? 0 : -1; | |||||
+#elif defined(__FreeBSD__) | |||||
+ char devnode[80]; | |||||
+ if (ioctl(uinput_dev->fd, UI_GET_SYSNAME(sizeof(devnode)), devnode) < 0) | |||||
+ return -1; | |||||
+ asprintf(&uinput_dev->devnode, "/dev/input/%s", devnode); | |||||
+ uinput_dev->syspath = strdup(uinput_dev->devnode); | |||||
+ return 0; | |||||
+#else | |||||
+ return -1; | |||||
+#endif | |||||
} | |||||
static int |