Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/joystick/webos/dev_presence.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Loading