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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292741
91177308-0d34-0410-b5e6-
96231b3b80d8
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 {