diff options
author | Viktor Kutuzov <vkutuzov@accesssoftek.com> | 2014-09-06 07:59:05 +0000 |
---|---|---|
committer | Viktor Kutuzov <vkutuzov@accesssoftek.com> | 2014-09-06 07:59:05 +0000 |
commit | 75e31aeb898f1d677dae6c06152f110670ca418f (patch) | |
tree | 0a1b60a4b8298aa129fbda105bd1b5e6f60ddcc6 /compiler-rt/lib/tsan/tests/rtl/tsan_test_util_linux.cc | |
parent | 1827415be49da39124bace6b2c7e2251734e52fd (diff) | |
download | bcm5719-llvm-75e31aeb898f1d677dae6c06152f110670ca418f.tar.gz bcm5719-llvm-75e31aeb898f1d677dae6c06152f110670ca418f.zip |
Support building tsan_test_util_linux.cc on FreeBSD
Differential Revision: http://reviews.llvm.org/D5210
llvm-svn: 217309
Diffstat (limited to 'compiler-rt/lib/tsan/tests/rtl/tsan_test_util_linux.cc')
-rw-r--r-- | compiler-rt/lib/tsan/tests/rtl/tsan_test_util_linux.cc | 11 |
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: |