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

Unified Diff: base/files/file_path_watcher_linux.cc

Issue 8681006: Add CHECKs for file descriptors used in select() by InotifyReaderTask (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_path_watcher_linux.cc
diff --git a/base/files/file_path_watcher_linux.cc b/base/files/file_path_watcher_linux.cc
index 6dc4ab9cd55bb8db4765bf1b21db5d32d6b91773..c9be4bacdde0493e3556fbabbcf8ebb8b28a4f08 100644
--- a/base/files/file_path_watcher_linux.cc
+++ b/base/files/file_path_watcher_linux.cc
@@ -158,6 +158,11 @@ class InotifyReaderTask : public Task {
: reader_(reader),
inotify_fd_(inotify_fd),
shutdown_fd_(shutdown_fd) {
+ // Make sure the file descriptors are good for use with select().
+ CHECK_LE(0, inotify_fd_);
+ CHECK_GT(FD_SETSIZE, inotify_fd_);
+ CHECK_LE(0, shutdown_fd_);
+ CHECK_GT(FD_SETSIZE, shutdown_fd_);
}
virtual void Run() {
« 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