diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-19 20:05:09 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-19 20:05:09 +0000 |
commit | e78a4bdac1ba55acea8d753d38a6afe775da4211 (patch) | |
tree | 40c4a98b48012aaab4b86ae8d3cb3405435eef1b /base/directory_watcher_inotify.cc | |
parent | d92c7c0152bc190c98c1a3174ceca6f08a5dcca6 (diff) | |
download | chromium_src-e78a4bdac1ba55acea8d753d38a6afe775da4211.zip chromium_src-e78a4bdac1ba55acea8d753d38a6afe775da4211.tar.gz chromium_src-e78a4bdac1ba55acea8d753d38a6afe775da4211.tar.bz2 |
Fix gcc 4.3 warning in directory_watcher_inotify.cc
- check return value of write to self-pipe
Review URL: http://codereview.chromium.org/42403
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12150 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/directory_watcher_inotify.cc')
-rw-r--r-- | base/directory_watcher_inotify.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/base/directory_watcher_inotify.cc b/base/directory_watcher_inotify.cc index c365352..a17e1e4 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(); } if (inotify_fd_ >= 0) |