[PATCH] D45322: [libFuzzer] Print a correct error message when a director can't be opened

Matt Morehouse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 6 11:18:22 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL329438: [libFuzzer] Print a correct error message when a directory can't be (authored by morehouse, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D45322

Files:
  compiler-rt/trunk/lib/fuzzer/FuzzerIOPosix.cpp
  compiler-rt/trunk/test/fuzzer/fuzzer-dirs.test


Index: compiler-rt/trunk/lib/fuzzer/FuzzerIOPosix.cpp
===================================================================
--- compiler-rt/trunk/lib/fuzzer/FuzzerIOPosix.cpp
+++ compiler-rt/trunk/lib/fuzzer/FuzzerIOPosix.cpp
@@ -54,7 +54,7 @@
 
   DIR *D = opendir(Dir.c_str());
   if (!D) {
-    Printf("No such directory: %s; exiting\n", Dir.c_str());
+    Printf("%s: %s; exiting\n", strerror(errno), Dir.c_str());
     exit(1);
   }
   while (auto E = readdir(D)) {
Index: compiler-rt/trunk/test/fuzzer/fuzzer-dirs.test
===================================================================
--- compiler-rt/trunk/test/fuzzer/fuzzer-dirs.test
+++ compiler-rt/trunk/test/fuzzer/fuzzer-dirs.test
@@ -17,5 +17,5 @@
 RUN: rm -rf %t/SUB1
 
 RUN: not %t-SimpleTest NONEXISTENT_DIR 2>&1 | FileCheck %s --check-prefix=NONEXISTENT_DIR
-NONEXISTENT_DIR: No such directory: NONEXISTENT_DIR; exiting
+NONEXISTENT_DIR: No such file or directory: NONEXISTENT_DIR; exiting
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45322.141386.patch
Type: text/x-patch
Size: 959 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180406/6c83a9f6/attachment.bin>


More information about the llvm-commits mailing list