Pass PTY slave as test program stdio

This commit is contained in:
pjht 2024-09-22 13:57:04 -05:00
parent 6e9938c5fc
commit b903788696
Signed by: pjht
GPG Key ID: 7B5F6AFBEC7EE78E

View File

@ -68,7 +68,14 @@ fn main() {
let mut pty = File::open("/dev/ptmx").unwrap();
Command::new("/bin/pts_tester").spawn().unwrap();
let pts = File::open("/dev/pts0").unwrap();
Command::new("/bin/pts_tester")
.stdin(pts.try_clone().unwrap())
.stdout(pts.try_clone().unwrap())
.stderr(pts)
.spawn()
.unwrap();
let mut kbd_buf = [0u8; 512];
let mut pty_buf = [0u8; 512];