File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -63,12 +63,13 @@ pub fn raw_pty() -> Result<RawPtyGuard, IoError> {
63
63
}
64
64
65
65
pub struct RawPtyGuard {
66
- saved : Termios ,
66
+ // nix Termios isn't Sync, pending https://github.com/nix-rust/nix/pull/1324
67
+ saved : libc:: termios ,
67
68
}
68
69
69
70
impl RawPtyGuard {
70
71
fn new ( ) -> Result < Self , IoError > {
71
- let saved = Self :: set_raw ( ) ?;
72
+ let saved = Self :: set_raw ( ) ?. into ( ) ;
72
73
73
74
Ok ( Self {
74
75
saved,
@@ -111,7 +112,7 @@ impl Drop for RawPtyGuard {
111
112
fn drop ( & mut self ) {
112
113
use nix:: sys:: termios:: * ;
113
114
let fd = std:: io:: stdin ( ) . as_raw_fd ( ) ;
114
- let r = tcsetattr ( fd, SetArg :: TCSADRAIN , & self . saved ) ;
115
+ let r = tcsetattr ( fd, SetArg :: TCSADRAIN , & self . saved . into ( ) ) ;
115
116
if let Err ( e) = r {
116
117
warn ! ( "Failed restoring TTY: {e}" ) ;
117
118
}
You can’t perform that action at this time.
0 commit comments