Commit 2f240964 authored by spang@chromium.org's avatar spang@chromium.org

evdev: Only open /dev/input/event*[0-9] devices

We're not interested in compatibility devices like /dev/input/mice, so
don't open them.

Also, udevd creates temporary files named like <device>.udev-tmp, so only
match devices that end in a number.

Review URL: https://codereview.chromium.org/146823004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247729 0039d316-1c4b-4281-b951-d872f2087c98
parent 5d4c4b6a
......@@ -80,8 +80,10 @@ void EventFactoryEvdev::AttachInputDevice(const base::FilePath& path) {
void EventFactoryEvdev::StartProcessingEvents() {
base::ThreadRestrictions::AssertIOAllowed();
base::FileEnumerator file_enum(
base::FilePath("/dev/input"), false, base::FileEnumerator::FILES);
base::FileEnumerator file_enum(base::FilePath("/dev/input"),
false,
base::FileEnumerator::FILES,
"event*[0-9]");
for (base::FilePath path = file_enum.Next(); !path.empty();
path = file_enum.Next())
AttachInputDevice(path);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment