From 26928e3ae90966e84d9e5f052631802ca634d99f Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Sun, 3 Mar 2024 14:02:52 +0200 Subject: [PATCH] terminal: fix compilation for macos Fixes: 70fc2b455c5b6dbfbfc0f505e597942712298c7b ("Update nix dependency to 0.27") Signed-off-by: Manos Pitsidianakis --- meli/src/terminal/embedded.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/meli/src/terminal/embedded.rs b/meli/src/terminal/embedded.rs index 01f3bc93..c8b98279 100644 --- a/meli/src/terminal/embedded.rs +++ b/meli/src/terminal/embedded.rs @@ -19,6 +19,8 @@ * along with meli. If not, see . */ +#[cfg(target_os = "macos")] +use std::os::fd::OwnedFd; use std::{ ffi::{CString, OsStr}, os::unix::{ @@ -78,7 +80,7 @@ ioctl_none_bad!( /// `command` in it. pub fn create_pty(width: usize, height: usize, command: String) -> Result>> { #[cfg(not(target_os = "macos"))] - let (frontend_fd, backend_name) = { + let (frontend_fd, backend_name): (nix::pty::PtyMaster, String) = { // Open a new PTY frontend let frontend_fd = posix_openpt(OFlag::O_RDWR)?; @@ -103,7 +105,7 @@ pub fn create_pty(width: usize, height: usize, command: String) -> Result::try_from(height).unwrap(), ws_col: ::try_from(width).unwrap(), @@ -122,12 +124,12 @@ pub fn create_pty(width: usize, height: usize, command: String) -> Result { log::error!( "Could not execute `{command}`: ioctl(fd, TIOCSCTTY, NULL) returned {c}",