Commit 38c57c5d authored by rmcilroy's avatar rmcilroy Committed by Commit bot

[Test] Don't call deprecated readdir_r in generate-bytecode-expectations.

Review-Url: https://codereview.chromium.org/2385653002
Cr-Commit-Position: refs/heads/master@{#39911}
parent 51bea9f0
...@@ -127,15 +127,14 @@ bool CollectGoldenFiles(std::vector<std::string>* golden_file_list, ...@@ -127,15 +127,14 @@ bool CollectGoldenFiles(std::vector<std::string>* golden_file_list,
DIR* directory = opendir(directory_path); DIR* directory = opendir(directory_path);
if (!directory) return false; if (!directory) return false;
dirent entry_buffer; dirent* entry = readdir(directory);
dirent* entry; while (entry) {
while (readdir_r(directory, &entry_buffer, &entry) == 0 && entry) {
if (StrEndsWith(entry->d_name, ".golden")) { if (StrEndsWith(entry->d_name, ".golden")) {
std::string golden_filename(kGoldenFilesPath); std::string golden_filename(kGoldenFilesPath);
golden_filename += entry->d_name; golden_filename += entry->d_name;
golden_file_list->push_back(golden_filename); golden_file_list->push_back(golden_filename);
} }
entry = readdir(directory);
} }
closedir(directory); closedir(directory);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment