Skip to content

Commit

Permalink
stty: Drop direct libc dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
VorpalBlade committed Feb 21, 2023
1 parent 3df6fcb commit 88873d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/uu/stty/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ path = "src/stty.rs"

[dependencies]
clap = { workspace=true }
libc = { workspace=true }
uucore = { workspace=true }
nix = { workspace=true, features = ["term", "ioctl"] }

Expand Down
4 changes: 2 additions & 2 deletions src/uu/stty/src/stty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
mod flags;

use clap::{crate_version, Arg, ArgAction, ArgMatches, Command};
use nix::libc::{c_ushort, TIOCGWINSZ, TIOCSWINSZ};
use nix::libc::{c_ushort, O_NONBLOCK, TIOCGWINSZ, TIOCSWINSZ};
use nix::sys::termios::{
cfgetospeed, tcgetattr, tcsetattr, ControlFlags, InputFlags, LocalFlags, OutputFlags, Termios,
};
Expand Down Expand Up @@ -114,7 +114,7 @@ impl<'a> Options<'a> {
// BorrowedFd/OwnedFd to handle both cases.
Some(f) => std::fs::OpenOptions::new()
.read(true)
.custom_flags(libc::O_NONBLOCK)
.custom_flags(O_NONBLOCK)
.open(f)?
.into_raw_fd(),
None => stdout().as_raw_fd(),
Expand Down

0 comments on commit 88873d8

Please sign in to comment.