Skip to content

Commit bf77f50

Browse files
bors[bot]jclulow
andauthored
Merge #1290
1290: use subordinate terminal device for termios calls r=asomers a=jclulow The pseudo-terminal device handling tests in some places make tcgetattr(3C) and tcsetattr(3C) calls using the control/manager file descriptor rather than the subordinate terminal descriptor. This works on some systems, but not all; others such as illumos (and presumably Solaris) are more strict and require the termios requests be made against the terminal descriptor only. Co-authored-by: Joshua M. Clulow <[email protected]>
2 parents 645309d + 7d0127f commit bf77f50

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

test/sys/test_termios.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn test_tcgetattr_pty() {
2222
let _m = crate::PTSNAME_MTX.lock().expect("Mutex got poisoned by another test");
2323

2424
let pty = openpty(None, None).expect("openpty failed");
25-
assert!(termios::tcgetattr(pty.master).is_ok());
25+
assert!(termios::tcgetattr(pty.slave).is_ok());
2626
close(pty.master).expect("closing the master failed");
2727
close(pty.slave).expect("closing the slave failed");
2828
}
@@ -53,7 +53,7 @@ fn test_output_flags() {
5353
let pty = openpty(None, None).expect("openpty failed");
5454
assert!(pty.master > 0);
5555
assert!(pty.slave > 0);
56-
let termios = tcgetattr(pty.master).expect("tcgetattr failed");
56+
let termios = tcgetattr(pty.slave).expect("tcgetattr failed");
5757
close(pty.master).unwrap();
5858
close(pty.slave).unwrap();
5959
termios
@@ -95,7 +95,7 @@ fn test_local_flags() {
9595
let pty = openpty(None, None).unwrap();
9696
assert!(pty.master > 0);
9797
assert!(pty.slave > 0);
98-
let termios = tcgetattr(pty.master).unwrap();
98+
let termios = tcgetattr(pty.slave).unwrap();
9999
close(pty.master).unwrap();
100100
close(pty.slave).unwrap();
101101
termios

test/test_pty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ fn test_openpty_with_termios() {
205205
let pty = openpty(None, None).unwrap();
206206
assert!(pty.master > 0);
207207
assert!(pty.slave > 0);
208-
let termios = tcgetattr(pty.master).unwrap();
208+
let termios = tcgetattr(pty.slave).unwrap();
209209
close(pty.master).unwrap();
210210
close(pty.slave).unwrap();
211211
termios

0 commit comments

Comments
 (0)