summaryrefslogtreecommitdiff
path: root/lib/tsan/rtl/tsan_suppressions.cc
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2013-05-08 14:43:49 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2013-05-08 14:43:49 +0000
commit9578a3ecfc35a264ede1135033398e2a77a6cad6 (patch)
tree5e4cb064cb5c58ec85e5a9705ae92226b18bddd3 /lib/tsan/rtl/tsan_suppressions.cc
parent33280bba681b7bb683be01749aaba70dc06ffb6c (diff)
[nolibc] Change internal syscall API to remove reliance on libc's errno.
This change moves to a model where the error value of a system call is potentially contained in the return value itself rather than being implicit in errno. The helper function internal_iserror can be used to extract the error value from a return value. On platforms other than Linux/x86_64 this still uses errno, but other platforms are free to port their error handling to this new model. Differential Revision: http://llvm-reviews.chandlerc.com/D756 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181436 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan/rtl/tsan_suppressions.cc')
-rw-r--r--lib/tsan/rtl/tsan_suppressions.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/tsan/rtl/tsan_suppressions.cc b/lib/tsan/rtl/tsan_suppressions.cc
index 47fe7b2d4..14b6a3aca 100644
--- a/lib/tsan/rtl/tsan_suppressions.cc
+++ b/lib/tsan/rtl/tsan_suppressions.cc
@@ -38,12 +38,13 @@ static char *ReadFile(const char *filename) {
internal_snprintf(tmp.data(), tmp.size(), "%s", filename);
else
internal_snprintf(tmp.data(), tmp.size(), "%s/%s", GetPwd(), filename);
- fd_t fd = OpenFile(tmp.data(), false);
- if (fd == kInvalidFd) {
+ uptr openrv = OpenFile(tmp.data(), false);
+ if (internal_iserror(openrv)) {
Printf("ThreadSanitizer: failed to open suppressions file '%s'\n",
tmp.data());
Die();
}
+ fd_t fd = openrv;
const uptr fsize = internal_filesize(fd);
if (fsize == (uptr)-1) {
Printf("ThreadSanitizer: failed to stat suppressions file '%s'\n",