From 5230233ab30087048b022fcfa0bd4e7e647386be Mon Sep 17 00:00:00 2001 From: Mariotaku Date: Thu, 24 Sep 2026 08:26:05 +0900 Subject: [PATCH] webos: only ask /sys/class/input about input nodes /sys/class/input only lists evdev and js nodes, so wherever /sys/dev is missing (every production jail) it reported every hidraw node as absent. Let other names fall through to the open() probe. Co-Authored-By: Claude Opus 5.5 --- src/joystick/webos/dev_presence.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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; }