aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/cpp/blaze_util_test.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/test/cpp/blaze_util_test.cc b/src/test/cpp/blaze_util_test.cc
index baf96458e6..44347364a0 100644
--- a/src/test/cpp/blaze_util_test.cc
+++ b/src/test/cpp/blaze_util_test.cc
@@ -65,7 +65,11 @@ class BlazeUtilTest : public ::testing::Test {
static int WriteFileDescriptor2(string input1, string input2) {
// create a fd for the input string
int fds[2];
- if (pipe2(fds, O_NONBLOCK) == -1) {
+ if (pipe(fds) == -1) {
+ return -1;
+ }
+ if (fcntl(fds[0], F_SETFL, O_NONBLOCK) == -1
+ || fcntl(fds[1], F_SETFL, O_NONBLOCK) == -1) {
return -1;
}
if (input2.size() > 0) {