Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1208)

Side by Side Diff: ui/events/ozone/evdev/event_factory.cc

Issue 146823004: evdev: Only open /dev/input/event*[0-9] devices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/events/ozone/evdev/event_factory.h" 5 #include "ui/events/ozone/evdev/event_factory.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <linux/input.h> 9 #include <linux/input.h>
10 #include <poll.h> 10 #include <poll.h>
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 converter->Start(); 75 converter->Start();
76 converters_[path] = converter.release(); 76 converters_[path] = converter.release();
77 } else { 77 } else {
78 close(fd); 78 close(fd);
79 } 79 }
80 } 80 }
81 81
82 void EventFactoryEvdev::StartProcessingEvents() { 82 void EventFactoryEvdev::StartProcessingEvents() {
83 base::ThreadRestrictions::AssertIOAllowed(); 83 base::ThreadRestrictions::AssertIOAllowed();
84 84
85 base::FileEnumerator file_enum( 85 base::FileEnumerator file_enum(base::FilePath("/dev/input"),
86 base::FilePath("/dev/input"), false, base::FileEnumerator::FILES); 86 false,
87 base::FileEnumerator::FILES,
88 "event*[0-9]");
87 for (base::FilePath path = file_enum.Next(); !path.empty(); 89 for (base::FilePath path = file_enum.Next(); !path.empty();
88 path = file_enum.Next()) 90 path = file_enum.Next())
89 AttachInputDevice(path); 91 AttachInputDevice(path);
90 } 92 }
91 93
92 } // namespace ui 94 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698