From: Timur Iskhodzhanov Date: Thu, 23 Apr 2015 13:18:50 +0000 (+0000) Subject: [Sanitizer coverage] Print out the error number if OpenFile fails X-Git-Tag: llvmorg-3.7.0-rc1~6176 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac990bfcd370388c59966441f2cca509baaace68;p=platform%2Fupstream%2Fllvm.git [Sanitizer coverage] Print out the error number if OpenFile fails llvm-svn: 235593 --- diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep.cc b/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep.cc index 2c7c7e0..171c6ca 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep.cc @@ -571,9 +571,11 @@ static fd_t CovOpenFile(InternalScopedString *path, bool packed, 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; }