mirror of
https://github.com/rcore-os/rCore-Tutorial-v3.git
synced 2024-11-22 09:26:26 +04:00
Close all pipes in pipetest.
This commit is contained in:
parent
8b27976d23
commit
12c6c53af5
@ -23,6 +23,8 @@ pub fn main() -> i32 {
|
||||
close(pipe_fd[1]);
|
||||
let mut buffer = [0u8; 32];
|
||||
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);
|
||||
println!("Read OK, child process exited!");
|
||||
0
|
||||
|
Loading…
Reference in New Issue
Block a user