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> {
6363}
6464
6565pub struct RawPtyGuard {
66- saved : Termios ,
66+ // nix Termios isn't Sync, pending https://github.com/nix-rust/nix/pull/1324
67+ saved : libc:: termios ,
6768}
6869
6970impl RawPtyGuard {
7071 fn new ( ) -> Result < Self , IoError > {
71- let saved = Self :: set_raw ( ) ?;
72+ let saved = Self :: set_raw ( ) ?. into ( ) ;
7273
7374 Ok ( Self {
7475 saved,
@@ -111,7 +112,7 @@ impl Drop for RawPtyGuard {
111112 fn drop ( & mut self ) {
112113 use nix:: sys:: termios:: * ;
113114 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 ( ) ) ;
115116 if let Err ( e) = r {
116117 warn ! ( "Failed restoring TTY: {e}" ) ;
117118 }
You can’t perform that action at this time.
0 commit comments