mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 13:01:21 -03:00
committed by
Johannes Altmanninger
parent
131febed2a
commit
735f3ae6ad
@@ -19,7 +19,7 @@
|
||||
use crate::signal::{Signal, signal_set_handlers_once};
|
||||
use crate::topic_monitor::{GenerationsList, Topic, topic_monitor_principal};
|
||||
use crate::wait_handle::{InternalJobId, WaitHandle, WaitHandleRef, WaitHandleStore};
|
||||
use crate::wutil::{wbasename, wperror};
|
||||
use crate::wutil::{perror, wbasename};
|
||||
use cfg_if::cfg_if;
|
||||
use fish_widestring::ToWString;
|
||||
use libc::{
|
||||
@@ -854,8 +854,7 @@ pub fn resume(&self) -> bool {
|
||||
pub fn signal(&self, signal: NixSignal) -> bool {
|
||||
if let Some(pgid) = self.group().get_pgid() {
|
||||
if killpg(pgid.as_nix_pid(), signal).is_err() {
|
||||
let strsignal = signal.as_str();
|
||||
wperror(&sprintf!("killpg(%d, %s)", pgid, strsignal));
|
||||
perror(&format!("killpg({pgid}, {})", signal.as_str()));
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
use crate::topic_monitor::Topic;
|
||||
use errno::errno;
|
||||
use fish_util::write_to_fd;
|
||||
use fish_wcstringutil::{join_strings, str2bytes_callback, wcs2bytes, wcs2osstring, wcs2zstring};
|
||||
use fish_wcstringutil::{join_strings, str2bytes_callback, wcs2osstring, wcs2zstring};
|
||||
use fish_widestring::{IntoCharIter, L, WExt as _, WString, wstr};
|
||||
use nix::unistd::AccessFlags;
|
||||
use std::ffi::{CStr, OsStr};
|
||||
@@ -66,13 +66,6 @@ pub fn wunlink(file_name: &wstr) -> io::Result<()> {
|
||||
fs::remove_file(tmp)
|
||||
}
|
||||
|
||||
pub fn wperror(s: &wstr) {
|
||||
let bytes = wcs2bytes(s);
|
||||
// We can't guarantee the string is 100% Unicode (why?), so we don't use std::str::from_utf8()
|
||||
let s = OsStr::from_bytes(&bytes).to_string_lossy();
|
||||
perror(&s);
|
||||
}
|
||||
|
||||
/// Port of the wide-string wperror from `src/wutil.cpp` but for rust `&str`.
|
||||
pub fn perror(s: &str) {
|
||||
let e = errno().0;
|
||||
|
||||
Reference in New Issue
Block a user