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

Unified Diff: base/directory_watcher_inotify.cc

Issue 42403: Fix gcc 4.3 warning in directory_watcher_inotify.cc (Closed)
Patch Set: do it better Created 11 years, 9 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 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/directory_watcher_inotify.cc
diff --git a/base/directory_watcher_inotify.cc b/base/directory_watcher_inotify.cc
index c36535233d795c08beb0540f8410c7aff9571238..a17e1e4ace037d3618c736a43ca0fe0c8352d12e 100644
--- a/base/directory_watcher_inotify.cc
+++ b/base/directory_watcher_inotify.cc
@@ -186,8 +186,14 @@ InotifyReader::InotifyReader()
InotifyReader::~InotifyReader() {
if (valid_) {
- // Write to the self-pipe so that the select call in InotifyReaderTask returns.
- write(shutdown_pipe_[1], "", 1);
+ // Write to the self-pipe so that the select call in InotifyReaderTask
+ // returns.
+ ssize_t bytes_written;
+ do {
+ bytes_written = write(shutdown_pipe_[1], "", 1);
+ if (bytes_written == 0)
+ continue;
+ } while (bytes_written == -1 && errno == EINTR);
thread_.Stop();
Mark Mentovai 2009/03/19 19:01:57 You can keep the DCHECK that you had in the last v
}
if (inotify_fd_ >= 0)
« 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