Skip to content

Commit

Permalink
Revert "Replace libc with rustix"
Browse files Browse the repository at this point in the history
This reverts commit 571312d.
  • Loading branch information
David Peter committed Dec 5, 2022
1 parent e888021 commit 421bd73
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ anstyle = "0.2"
anyhow = "1.0"
const_format = "0.2"
is-terminal = "0.4"
rustix = "0.36"
libc = "0.2"
thiserror = "1.0"
terminal_size = "0.2"

Expand Down
5 changes: 2 additions & 3 deletions src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ use std::convert::TryFrom;
use std::fs;
use std::io::{self, copy, sink, Read, Seek, SeekFrom};

use rustix::io::Errno;

pub enum Input<'a> {
File(fs::File),
Stdin(io::StdinLock<'a>),
Expand Down Expand Up @@ -37,7 +35,8 @@ impl<'a> Seek for Input<'a> {
match *self {
Input::File(ref mut file) => {
let seek_res = file.seek(pos);
if let Err(Some(Errno::SPIPE)) = seek_res.as_ref().map_err(Errno::from_io_error) {
if let Err(Some(libc::ESPIPE)) = seek_res.as_ref().map_err(|err| err.raw_os_error())
{
try_skip(
file,
pos,
Expand Down

0 comments on commit 421bd73

Please sign in to comment.