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

Unified Diff: base/files/file_enumerator_posix.cc

Issue 2466773003: Revert of Replace some deprecated usages of readdir_r with readdir (Closed)
Patch Set: Created 4 years, 1 month 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 | net/disk_cache/simple/simple_index_file_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_enumerator_posix.cc
diff --git a/base/files/file_enumerator_posix.cc b/base/files/file_enumerator_posix.cc
index 16a04801c3ae450f5ad6c88a02571f12f5cdabde..fb4010aadcad566f304a899344f1cb892b666081 100644
--- a/base/files/file_enumerator_posix.cc
+++ b/base/files/file_enumerator_posix.cc
@@ -131,11 +131,9 @@
additional space for pathname may be needed
#endif
- // In all implementations of the C library that Chromium can run with,
- // concurrent calls to readdir that specify different directory streams are
- // thread-safe. This is the case here, since the directory stream is scoped to
- // the current function. See https://codereview.chromium.org/2411833004/#msg3
- for (struct dirent* dent = readdir(dir); dent; dent = readdir(dir)) {
+ struct dirent dent_buf;
+ struct dirent* dent;
+ while (readdir_r(dir, &dent_buf, &dent) == 0 && dent) {
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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698