[PATCH] D28711: [libFuzzer] Same behaviour for `ListFilesInDirRecursive` when non existing directory.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 13 15:20:46 PST 2017


mpividori created this revision.
mpividori added a reviewer: zturner.
mpividori added a subscriber: llvm-commits.
mpividori set the repository for this revision to rL LLVM.

Repository:
  rL LLVM

https://reviews.llvm.org/D28711

Files:
  lib/Fuzzer/FuzzerIOWindows.cpp


Index: lib/Fuzzer/FuzzerIOWindows.cpp
===================================================================
--- lib/Fuzzer/FuzzerIOWindows.cpp
+++ lib/Fuzzer/FuzzerIOWindows.cpp
@@ -89,8 +89,10 @@
   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 {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28711.84401.patch
Type: text/x-patch
Size: 527 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170113/bb1917ab/attachment.bin>


More information about the llvm-commits mailing list