mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:09:42 +00:00
Merge "Fix for nix 0.27.1." into main
This commit is contained in:
@@ -14,7 +14,6 @@ use tokio_util::sync::CancellationToken;
|
|||||||
|
|
||||||
use std::fs::{File, OpenOptions};
|
use std::fs::{File, OpenOptions};
|
||||||
use std::io::{self, Read, Write};
|
use std::io::{self, Read, Write};
|
||||||
use std::os::fd::AsRawFd;
|
|
||||||
use std::os::unix::fs::OpenOptionsExt;
|
use std::os::unix::fs::OpenOptionsExt;
|
||||||
|
|
||||||
enum State {
|
enum State {
|
||||||
@@ -61,13 +60,11 @@ impl State {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn makeraw(file: File) -> io::Result<File> {
|
pub fn makeraw(file: File) -> io::Result<File> {
|
||||||
let fd = file.as_raw_fd();
|
// Configure the file descriptor as raw fd.
|
||||||
|
|
||||||
// Configure the file descritpro as raw fd.
|
|
||||||
use nix::sys::termios::*;
|
use nix::sys::termios::*;
|
||||||
let mut attrs = tcgetattr(fd)?;
|
let mut attrs = tcgetattr(&file)?;
|
||||||
cfmakeraw(&mut attrs);
|
cfmakeraw(&mut attrs);
|
||||||
tcsetattr(fd, SetArg::TCSANOW, &attrs)?;
|
tcsetattr(&file, SetArg::TCSANOW, &attrs)?;
|
||||||
|
|
||||||
Ok(file)
|
Ok(file)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user