summaryrefslogtreecommitdiffstats
path: root/alacritty_terminal
diff options
context:
space:
mode:
authorChristian Duerr <chrisduerr@users.noreply.github.com>2019-08-04 20:17:22 +0000
committerGitHub <noreply@github.com>2019-08-04 20:17:22 +0000
commit14fa02648ece67f468fea77203a76b079406f324 (patch)
tree2ee0eae740081a1932ef791fc8b0163a9bc0cb24 /alacritty_terminal
parentddee14a6ef6e4c0621a2683b34aa25b3971155ef (diff)
Remove errno depedency
Diffstat (limited to 'alacritty_terminal')
-rw-r--r--alacritty_terminal/Cargo.toml1
-rw-r--r--alacritty_terminal/src/tty/unix.rs13
2 files changed, 4 insertions, 10 deletions
diff --git a/alacritty_terminal/Cargo.toml b/alacritty_terminal/Cargo.toml
index eb72e7d8..464a1370 100644
--- a/alacritty_terminal/Cargo.toml
+++ b/alacritty_terminal/Cargo.toml
@@ -14,7 +14,6 @@ libc = "0.2"
notify = "4"
bitflags = "1"
font = { path = "../font" }
-errno = "0.2"
parking_lot = "0.7"
serde = "1"
serde_derive = "1"
diff --git a/alacritty_terminal/src/tty/unix.rs b/alacritty_terminal/src/tty/unix.rs
index f4c5771f..8ed8ba03 100644
--- a/alacritty_terminal/src/tty/unix.rs
+++ b/alacritty_terminal/src/tty/unix.rs
@@ -46,11 +46,6 @@ pub fn child_pid() -> pid_t {
PID.load(Ordering::Relaxed) as pid_t
}
-/// Get the current value of errno
-fn errno() -> c_int {
- ::errno::errno().0
-}
-
/// Get raw fds for master/slave ends of a new pty
fn make_pty(size: winsize) -> (RawFd, RawFd) {
let mut win_size = size;
@@ -74,7 +69,7 @@ fn set_controlling_terminal(fd: c_int) {
};
if res < 0 {
- die!("ioctl TIOCSCTTY failed: {}", errno());
+ die!("ioctl TIOCSCTTY failed: {}", io::Error::last_os_error());
}
}
@@ -148,7 +143,7 @@ impl Pty {
let res = unsafe { libc::ioctl(self.fd.as_raw_fd(), libc::TIOCSWINSZ, &win as *const _) };
if res < 0 {
- die!("ioctl TIOCSWINSZ failed: {}", errno());
+ die!("ioctl TIOCSWINSZ failed: {}", io::Error::last_os_error());
}
}
}
@@ -199,7 +194,7 @@ pub fn new<T: ToWinsize>(config: &Config, size: &T, window_id: Option<usize>) ->
// Create a new process group
let err = libc::setsid();
if err == -1 {
- die!("Failed to set session id: {}", errno());
+ die!("Failed to set session id: {}", io::Error::last_os_error());
}
set_controlling_terminal(slave);
@@ -375,7 +370,7 @@ impl OnResize for i32 {
let res = unsafe { libc::ioctl(*self, libc::TIOCSWINSZ, &win as *const _) };
if res < 0 {
- die!("ioctl TIOCSWINSZ failed: {}", errno());
+ die!("ioctl TIOCSWINSZ failed: {}", io::Error::last_os_error());
}
}
}