[compiler-rt] r235593 - [Sanitizer coverage] Print out the error number if OpenFile fails

Timur Iskhodzhanov timurrrr at google.com
Thu Apr 23 06:18:50 PDT 2015


Author: timurrrr
Date: Thu Apr 23 08:18:50 2015
New Revision: 235593

URL: http://llvm.org/viewvc/llvm-project?rev=235593&view=rev
Log:
[Sanitizer coverage] Print out the error number if OpenFile fails


Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc?rev=235593&r1=235592&r2=235593&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc Thu Apr 23 08:18:50 2015
@@ -571,9 +571,11 @@ static fd_t CovOpenFile(InternalScopedSt
     else
       path->append("%s/%s.%s.packed", coverage_dir, name, extension);
   }
-  fd_t fd = OpenFile(path->data(), WrOnly);
+  error_t err;
+  fd_t fd = OpenFile(path->data(), WrOnly, &err);
   if (fd == kInvalidFd)
-    Report("SanitizerCoverage: failed to open %s for writing\n", path->data());
+    Report("SanitizerCoverage: failed to open %s for writing (reason: %d)\n",
+           path->data(), err);
   return fd;
 }
 





More information about the llvm-commits mailing list