summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorViktor Kutuzov <vkutuzov@accesssoftek.com>2014-09-06 07:59:05 +0000
committerViktor Kutuzov <vkutuzov@accesssoftek.com>2014-09-06 07:59:05 +0000
commit75e31aeb898f1d677dae6c06152f110670ca418f (patch)
tree0a1b60a4b8298aa129fbda105bd1b5e6f60ddcc6
parent1827415be49da39124bace6b2c7e2251734e52fd (diff)
downloadbcm5719-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
-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