diff options
author | Marcos Pividori <mpividori@google.com> | 2017-01-22 01:58:36 +0000 |
---|---|---|
committer | Marcos Pividori <mpividori@google.com> | 2017-01-22 01:58:36 +0000 |
commit | 72b5a237f135bf3e4afe93c3002d0ec044e17a20 (patch) | |
tree | ad2566db67dbea51fd644692f4ebea80bfcfcf1b /llvm/lib/Fuzzer/FuzzerIOWindows.cpp | |
parent | 62c10bf1188d80974f132c0c70d44780d394158c (diff) | |
download | bcm5719-llvm-72b5a237f135bf3e4afe93c3002d0ec044e17a20.tar.gz bcm5719-llvm-72b5a237f135bf3e4afe93c3002d0ec044e17a20.zip |
[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
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerIOWindows.cpp')
-rw-r--r-- | llvm/lib/Fuzzer/FuzzerIOWindows.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerIOWindows.cpp b/llvm/lib/Fuzzer/FuzzerIOWindows.cpp index e2a67973386..983cb6c2e4a 100644 --- a/llvm/lib/Fuzzer/FuzzerIOWindows.cpp +++ b/llvm/lib/Fuzzer/FuzzerIOWindows.cpp @@ -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 { |