1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 13:11:39 +01:00

[libFuzzer] Fix ListFilesInDirRecursive() to do the same for Posix and Windows.

Update `ListFilesInDirRecursive` implementation on Windows to have the same
behavior than for Posix, when the directory doesn't exists and when it is empty.

Differential Revision: https://reviews.llvm.org/D28711

llvm-svn: 292741
This commit is contained in:
Marcos Pividori 2017-01-22 01:58:36 +00:00
parent f17b48052b
commit d0fb74ae0a

View File

@ -89,8 +89,10 @@ void ListFilesInDirRecursive(const std::string &Dir, long *Epoch,
HANDLE FindHandle(FindFirstFileA(Path.c_str(), &FindInfo));
if (FindHandle == INVALID_HANDLE_VALUE)
{
Printf("No file found in: %s.\n", Dir.c_str());
return;
if (GetLastError() == ERROR_FILE_NOT_FOUND)
return;
Printf("No such directory: %s; exiting\n", Dir.c_str());
exit(1);
}
do {