From afc52a3e6a8dd275d48a5e21cb15086b3ec63b5b Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Sat, 21 Dec 2013 19:44:29 -0800 Subject: fix travis errors --- src/io/read_test.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/io') diff --git a/src/io/read_test.cpp b/src/io/read_test.cpp index 193777f..8c459cbb 100644 --- a/src/io/read_test.cpp +++ b/src/io/read_test.cpp @@ -7,10 +7,15 @@ static int string_pipe(ZString sz) { - // if this doesn't work we'll get test failures anyway int pfd[2]; - pipe(pfd); - write(pfd[1], sz.c_str(), sz.size()); + if (-1 == pipe(pfd)) + return -1; + if (sz.size() != write(pfd[1], sz.c_str(), sz.size())) + { + close(pfd[0]); + close(pfd[1]); + return -1; + } close(pfd[1]); return pfd[0]; } -- cgit v1.2.3-70-g09d2