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

Side by Side Diff: base/files/dir_reader_linux.h

Issue 100253002: Don't HANDLE_EINTR(close). Either IGNORE_EINTR(close) or just close. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years 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 | « base/file_util_posix.cc ('k') | base/files/file_path_watcher_kqueue.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef BASE_FILES_DIR_READER_LINUX_H_ 5 #ifndef BASE_FILES_DIR_READER_LINUX_H_
6 #define BASE_FILES_DIR_READER_LINUX_H_ 6 #define BASE_FILES_DIR_READER_LINUX_H_
7 7
8 #include <errno.h> 8 #include <errno.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 19 matching lines...) Expand all
30 public: 30 public:
31 explicit DirReaderLinux(const char* directory_path) 31 explicit DirReaderLinux(const char* directory_path)
32 : fd_(open(directory_path, O_RDONLY | O_DIRECTORY)), 32 : fd_(open(directory_path, O_RDONLY | O_DIRECTORY)),
33 offset_(0), 33 offset_(0),
34 size_(0) { 34 size_(0) {
35 memset(buf_, 0, sizeof(buf_)); 35 memset(buf_, 0, sizeof(buf_));
36 } 36 }
37 37
38 ~DirReaderLinux() { 38 ~DirReaderLinux() {
39 if (fd_ >= 0) { 39 if (fd_ >= 0) {
40 if (HANDLE_EINTR(close(fd_))) 40 if (IGNORE_EINTR(close(fd_)))
41 RAW_LOG(ERROR, "Failed to close directory handle"); 41 RAW_LOG(ERROR, "Failed to close directory handle");
42 } 42 }
43 } 43 }
44 44
45 bool IsValid() const { 45 bool IsValid() const {
46 return fd_ >= 0; 46 return fd_ >= 0;
47 } 47 }
48 48
49 // Move to the next entry returning false if the iteration is complete. 49 // Move to the next entry returning false if the iteration is complete.
50 bool Next() { 50 bool Next() {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 const int fd_; 89 const int fd_;
90 unsigned char buf_[512]; 90 unsigned char buf_[512];
91 size_t offset_, size_; 91 size_t offset_, size_;
92 92
93 DISALLOW_COPY_AND_ASSIGN(DirReaderLinux); 93 DISALLOW_COPY_AND_ASSIGN(DirReaderLinux);
94 }; 94 };
95 95
96 } // namespace base 96 } // namespace base
97 97
98 #endif // BASE_FILES_DIR_READER_LINUX_H_ 98 #endif // BASE_FILES_DIR_READER_LINUX_H_
OLDNEW
« no previous file with comments | « base/file_util_posix.cc ('k') | base/files/file_path_watcher_kqueue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698