diff options
author | Joshua M. Clulow <jmc@oxide.computer> | 2020-08-11 16:01:19 -0700 |
---|---|---|
committer | Joshua M. Clulow <jmc@oxide.computer> | 2020-08-11 16:01:19 -0700 |
commit | 7d0127fa251634424316205d4e6b82b3313f2305 (patch) | |
tree | a1c72f267c36cee72a6a5232abbe5a5403163775 /test/sys/test_termios.rs | |
parent | 96054b6933404b4c1d5dbd49db7ec7c7a26e44de (diff) | |
download | nix-7d0127fa251634424316205d4e6b82b3313f2305.zip |
use subordinate terminal device for termios calls
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.
Diffstat (limited to 'test/sys/test_termios.rs')
-rw-r--r-- | test/sys/test_termios.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/sys/test_termios.rs b/test/sys/test_termios.rs index 4fa6df9b..00aeb2fc 100644 --- a/test/sys/test_termios.rs +++ b/test/sys/test_termios.rs @@ -22,7 +22,7 @@ fn test_tcgetattr_pty() { let _m = crate::PTSNAME_MTX.lock().expect("Mutex got poisoned by another test"); let pty = openpty(None, None).expect("openpty failed"); - assert!(termios::tcgetattr(pty.master).is_ok()); + assert!(termios::tcgetattr(pty.slave).is_ok()); close(pty.master).expect("closing the master failed"); close(pty.slave).expect("closing the slave failed"); } @@ -53,7 +53,7 @@ fn test_output_flags() { let pty = openpty(None, None).expect("openpty failed"); assert!(pty.master > 0); assert!(pty.slave > 0); - let termios = tcgetattr(pty.master).expect("tcgetattr failed"); + let termios = tcgetattr(pty.slave).expect("tcgetattr failed"); close(pty.master).unwrap(); close(pty.slave).unwrap(); termios @@ -95,7 +95,7 @@ fn test_local_flags() { let pty = openpty(None, None).unwrap(); assert!(pty.master > 0); assert!(pty.slave > 0); - let termios = tcgetattr(pty.master).unwrap(); + let termios = tcgetattr(pty.slave).unwrap(); close(pty.master).unwrap(); close(pty.slave).unwrap(); termios |