diff --git a/crates/common/src/lib.rs b/crates/common/src/lib.rs index 031901b8e..960c3f9cf 100644 --- a/crates/common/src/lib.rs +++ b/crates/common/src/lib.rs @@ -213,7 +213,7 @@ fn read_to_end_interruptible(&mut self, buf: &mut Vec) -> std::io::Result<() /// A rusty port of the C++ `write_loop()` function from `common.cpp`. This should be deprecated in /// favor of native rust read/write methods at some point. -pub fn safe_write_loop(fd: &Fd, buf: &[u8]) -> std::io::Result<()> { +pub fn write_loop(fd: &Fd, buf: &[u8]) -> std::io::Result<()> { let fd = fd.as_raw_fd(); let mut total = 0; while total < buf.len() { @@ -232,8 +232,6 @@ pub fn safe_write_loop(fd: &Fd, buf: &[u8]) -> std::io::Result<()> Ok(()) } -pub use safe_write_loop as write_loop; - pub const fn help_section_exists(section: &str) -> bool { let haystack = include_str!("../../../share/help_sections"); let needle = section; diff --git a/src/tty_handoff.rs b/src/tty_handoff.rs index 88031c227..740d2eea4 100644 --- a/src/tty_handoff.rs +++ b/src/tty_handoff.rs @@ -17,7 +17,7 @@ }; use crate::threads::assert_is_main_thread; use crate::wutil::{perror_nix, wcstoi}; -use fish_common::{safe_write_loop, write_loop}; +use fish_common::write_loop; use fish_util::perror; use libc::{EINVAL, ENOTTY, EPERM, STDIN_FILENO, WNOHANG}; use nix::sys::termios::tcgetattr; @@ -336,7 +336,7 @@ pub fn safe_deactivate_tty_protocols() { let commands = protocols.safe_get_commands(false); // Safety: just writing data to stdout. - let _ = safe_write_loop(&libc::STDOUT_FILENO, commands); + let _ = write_loop(&libc::STDOUT_FILENO, commands); TTY_PROTOCOLS_ACTIVE.store(false, Ordering::Release); }