[compiler-rt] r217309 - Support building tsan_test_util_linux.cc on FreeBSD
Viktor Kutuzov
vkutuzov at accesssoftek.com
Sat Sep 6 00:59:05 PDT 2014
Author: vkutuzov
Date: Sat Sep 6 02:59:05 2014
New Revision: 217309
URL: http://llvm.org/viewvc/llvm-project?rev=217309&view=rev
Log:
Support building tsan_test_util_linux.cc on FreeBSD
Differential Revision: http://reviews.llvm.org/D5210
Modified:
compiler-rt/trunk/lib/tsan/tests/rtl/tsan_test_util_linux.cc
Modified: compiler-rt/trunk/lib/tsan/tests/rtl/tsan_test_util_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/tests/rtl/tsan_test_util_linux.cc?rev=217309&r1=217308&r2=217309&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/tests/rtl/tsan_test_util_linux.cc (original)
+++ compiler-rt/trunk/lib/tsan/tests/rtl/tsan_test_util_linux.cc Sat Sep 6 02:59:05 2014
@@ -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(Eve
}
}
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:
More information about the llvm-commits
mailing list