From 34412cea5c247e30e49958213df10dd8f128d7e5 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 24 Sep 2021 17:48:48 +0200 Subject: [PATCH] tsan: don't use pipe2 in tests MacOS buildbots failed: stress.cpp:57:7: error: use of undeclared identifier 'pipe2' https://green.lab.llvm.org/green//job/clang-stage1-RA/24209/consoleFull#-3468768778254eaf0-7326-4999-85b0-388101f2d404 Fix the test to not use pipe2. Differential Revision: https://reviews.llvm.org/D110423 --- compiler-rt/test/tsan/stress.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler-rt/test/tsan/stress.cpp b/compiler-rt/test/tsan/stress.cpp index 0565c67..d678395 100644 --- a/compiler-rt/test/tsan/stress.cpp +++ b/compiler-rt/test/tsan/stress.cpp @@ -54,8 +54,12 @@ void *Thread(void *x) { int main() { ANNOTATE_BENIGN_RACE(stop); - if (pipe2(fds, O_NONBLOCK)) - exit((perror("pipe2"), 1)); + if (pipe(fds)) + exit((perror("pipe"), 1)); + if (fcntl(fds[0], F_SETFL, O_NONBLOCK)) + exit((perror("fcntl"), 1)); + if (fcntl(fds[1], F_SETFL, O_NONBLOCK)) + exit((perror("fcntl"), 1)); const int kActions = 9; const int kMultiplier = 4; pthread_t t[kActions * kMultiplier]; -- 2.7.4