summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/tests
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/tsan/tests')
-rw-r--r--compiler-rt/lib/tsan/tests/rtl/tsan_test_util_linux.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler-rt/lib/tsan/tests/rtl/tsan_test_util_linux.cc b/compiler-rt/lib/tsan/tests/rtl/tsan_test_util_linux.cc
index a2601486a2e..9298bf051af 100644
--- a/compiler-rt/lib/tsan/tests/rtl/tsan_test_util_linux.cc
+++ b/compiler-rt/lib/tsan/tests/rtl/tsan_test_util_linux.cc
@@ -10,7 +10,7 @@
//
// This file is a part of ThreadSanitizer (TSan), a race detector.
//
-// Test utils, linux implementation.
+// Test utils, Linux and FreeBSD implementation.
//===----------------------------------------------------------------------===//
#include "sanitizer_common/sanitizer_atomic.h"
@@ -263,9 +263,14 @@ void ScopedThread::Impl::HandleEvent(Event *ev) {
}
}
CHECK_NE(tsan_mop, 0);
- errno = ECHRNG;
+#if defined(__FreeBSD__)
+ const int ErrCode = ESOCKTNOSUPPORT;
+#else
+ const int ErrCode = ECHRNG;
+#endif
+ errno = ErrCode;
tsan_mop(ev->ptr);
- CHECK_EQ(errno, ECHRNG); // In no case must errno be changed.
+ CHECK_EQ(ErrCode, errno); // In no case must errno be changed.
break;
}
case Event::VPTR_UPDATE:
OpenPOWER on IntegriCloud