From 077126c5eb0039a250a32daf9f31d44d00aefceb Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Sat, 11 Jan 2020 11:33:22 +0100 Subject: [PATCH] test: Make Logger test's pipe non-blocking. There are cases where we need to verify that the pipe is empty. --- test/logger_test.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/logger_test.rs b/test/logger_test.rs index 93568bb..2bb507f 100644 --- a/test/logger_test.rs +++ b/test/logger_test.rs @@ -80,10 +80,12 @@ impl Pipe { unsafe { extern { - fn pipe(pipefd: *mut i32) -> i32; + fn pipe2(pipefd: *mut i32, flags: i32) -> i32; } - pipe(pipe_fd.as_mut_ptr()); + const O_NONBLOCK : i32 = 0x800; + + pipe2(pipe_fd.as_mut_ptr(), O_NONBLOCK); } Pipe { -- 2.30.2