diff --git a/src/joystick/webos/dev_presence.c b/src/joystick/webos/dev_presence.c index 5f055ec992a96..c86de9b6813be 100644 --- a/src/joystick/webos/dev_presence.c +++ b/src/joystick/webos/dev_presence.c @@ -141,13 +141,19 @@ static NodeLiveness CheckSysDevChar(dev_t devnum) } /* Mounted in every jail config and lists only live nodes, but there is no - * /sys/class/hidraw to match it, so this answers for evdev and js only. */ + * /sys/class/hidraw to match it, so this answers for evdev and js only. + * hidraw would never be listed here, and reading that as absent would hide + * every hidraw node in a production jail. */ static NodeLiveness CheckSysClassInput(const char *name) { char path[128]; struct stat st; - if (name == NULL || stat("/sys/class/input", &st) != 0) { + if (name == NULL || (strncmp(name, "event", 5) != 0 && strncmp(name, "js", 2) != 0)) { + return NODE_LIVENESS_UNKNOWN; + } + + if (stat("/sys/class/input", &st) != 0) { return NODE_LIVENESS_UNKNOWN; }