Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/uu/stty/src/stty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -894,23 +894,24 @@ fn apply_saved_state(termios: &mut Termios, state: &(CFlags, CCFlags)) {
}

fn apply_special_setting(
_termios: &mut Termios,
termios: &mut Termios,
setting: &SpecialSetting,
fd: impl AsFd,
) -> io::Result<()> {
let mut size = tcgetwinsize(&fd)?;
match setting {
SpecialSetting::Rows(n) => size.ws_row = *n,
SpecialSetting::Cols(n) => size.ws_col = *n,
#[cfg_attr(
not(any(target_os = "linux", target_os = "android")),
expect(unused_variables)
)]
SpecialSetting::Line(n) => {
// nix only defines Termios's `line_discipline` field on these platforms
#[cfg(any(target_os = "linux", target_os = "android"))]
{
_termios.line_discipline = *n;
termios.line_discipline = *n;
}
#[cfg(not(any(target_os = "linux", target_os = "android")))]
{
let _ = termios;
let _ = n;
}
}
}
Expand Down
Loading