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

Unified Diff: base/files/file_enumerator_posix.cc

Issue 2411833004: Replace some deprecated usages of readdir_r with readdir (Closed)
Patch Set: Created 4 years, 2 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
Index: base/files/file_enumerator_posix.cc
diff --git a/base/files/file_enumerator_posix.cc b/base/files/file_enumerator_posix.cc
index fb4010aadcad566f304a899344f1cb892b666081..33a9d9f442ef60d7f61d76b5da010b3944c23416 100644
--- a/base/files/file_enumerator_posix.cc
+++ b/base/files/file_enumerator_posix.cc
@@ -131,9 +131,7 @@ bool FileEnumerator::ReadDirectory(std::vector<FileInfo>* entries,
additional space for pathname may be needed
#endif
- struct dirent dent_buf;
- struct dirent* dent;
- while (readdir_r(dir, &dent_buf, &dent) == 0 && dent) {
+ for (struct dirent* dent = readdir(dir); dent; dent = readdir(dir)) {
FileInfo info;
info.filename_ = FilePath(dent->d_name);
« no previous file with comments | « no previous file | net/disk_cache/simple/simple_index_file_posix.cc » ('j') | sandbox/linux/services/proc_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698