Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 116bf2a6 authored by Andrew Walbran's avatar Andrew Walbran
Browse files

Fix for nix 0.27.1.

Bug: 314091492
Test: m rust
Change-Id: I4cc495c69d11a0b93cb7bcc74183c295ec60aa32
parent 3cf2309b
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@ use tokio_util::sync::CancellationToken;

use std::fs::{File, OpenOptions};
use std::io::{self, Read, Write};
use std::os::fd::AsRawFd;
use std::os::unix::fs::OpenOptionsExt;

enum State {
@@ -61,13 +60,11 @@ impl State {
}

pub fn makeraw(file: File) -> io::Result<File> {
    let fd = file.as_raw_fd();

    // Configure the file descritpro as raw fd.
    // Configure the file descriptor as raw fd.
    use nix::sys::termios::*;
    let mut attrs = tcgetattr(fd)?;
    let mut attrs = tcgetattr(&file)?;
    cfmakeraw(&mut attrs);
    tcsetattr(fd, SetArg::TCSANOW, &attrs)?;
    tcsetattr(&file, SetArg::TCSANOW, &attrs)?;

    Ok(file)
}