aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2015-09-08 11:19:40 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-09-08 11:24:15 +0000
commit87a3c4932eef7c7f33cfed49e1e67680a75df658 (patch)
tree091cf85c61b8d48e739c6d59619f591962f6dc21 /src
parent83f8271fd9fae7c9fde473c28c1b7e3f7504442a (diff)
Replace pipe2() by pipe() and fnctl()
pipe2() does not exists on Darwin. -- MOS_MIGRATED_REVID=102544058
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) {