Chromium Code Reviews| 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) |