summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Peter <david.peter@bosch.com>2022-12-05 09:52:27 +0100
committerDavid Peter <david.peter@bosch.com>2022-12-05 09:52:27 +0100
commit421bd73ec1f673b809d6be0d14bca3af2f3cd719 (patch)
tree5bdf56875906fbc97b7f8ca57c361557f7449238
parente888021a48cbb7814b9a6f93237ba9bb0d42e6fe (diff)
Revert "Replace `libc` with `rustix`"v0.11.0
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml2
-rw-r--r--src/input.rs5
3 files changed, 4 insertions, 5 deletions
diff --git a/Cargo.lock b/Cargo.lock
index d4b933c..bf6597b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -194,9 +194,9 @@ dependencies = [
"clap",
"const_format",
"is-terminal",
+ "libc",
"predicates",
"pretty_assertions",
- "rustix",
"terminal_size",
"thiserror",
]
diff --git a/Cargo.toml b/Cargo.toml
index d510f4d..f0c2769 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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"
diff --git a/src/input.rs b/src/input.rs
index d6d9f5f..1e6fb06 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -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>),
@@ -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,