Close all pipes in pipetest.
This commit is contained in:
parent
3559f26b37
commit
c98c7c6558
1 changed files with 2 additions and 0 deletions
|
@ -23,6 +23,8 @@ pub fn main() -> i32 {
|
||||||
close(pipe_fd[1]);
|
close(pipe_fd[1]);
|
||||||
let mut buffer = [0u8; 32];
|
let mut buffer = [0u8; 32];
|
||||||
let len_read = read(pipe_fd[0], &mut buffer) as usize;
|
let len_read = read(pipe_fd[0], &mut buffer) as usize;
|
||||||
|
// close read_end
|
||||||
|
close(pipe_fd[0]);
|
||||||
assert_eq!(core::str::from_utf8(&buffer[..len_read]).unwrap(), STR);
|
assert_eq!(core::str::from_utf8(&buffer[..len_read]).unwrap(), STR);
|
||||||
println!("Read OK, child process exited!");
|
println!("Read OK, child process exited!");
|
||||||
0
|
0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue