mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-28 20:34:07 +08:00
wutil: add perror implementation that takes an io::Error
This commit is contained in:
parent
3d0b66c825
commit
0b291355b2
|
@ -22,7 +22,7 @@ pub(crate) use gettext::{wgettext, wgettext_fmt, wgettext_str};
|
|||
pub(crate) use printf::sprintf;
|
||||
use std::ffi::OsStr;
|
||||
use std::fs::{self, canonicalize};
|
||||
use std::io::Write;
|
||||
use std::io::{self, Write};
|
||||
use std::os::fd::{FromRawFd, IntoRawFd, RawFd};
|
||||
use std::os::unix::prelude::{OsStrExt, OsStringExt};
|
||||
|
||||
|
@ -81,6 +81,10 @@ pub fn perror(s: &str) {
|
|||
let _ = stderr.write_all(b"\n");
|
||||
}
|
||||
|
||||
pub fn perror_io(s: &str, e: &io::Error) {
|
||||
eprintln!("{}: {}", s, e);
|
||||
}
|
||||
|
||||
/// Wide character version of getcwd().
|
||||
pub fn wgetcwd() -> WString {
|
||||
let mut cwd = [b'\0'; libc::PATH_MAX as usize];
|
||||
|
|
Loading…
Reference in New Issue
Block a user