mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-03 15:01:16 -03:00
Minor refactoring of make_wait_handle
This commit is contained in:
20
src/proc.rs
20
src/proc.rs
@@ -521,19 +521,15 @@ pub fn is_completed(&self) -> bool {
|
|||||||
/// As a process does not know its job id, we pass it in.
|
/// As a process does not know its job id, we pass it in.
|
||||||
/// Note this will return null if the process is not waitable (has no pid).
|
/// Note this will return null if the process is not waitable (has no pid).
|
||||||
pub fn make_wait_handle(&self, jid: InternalJobId) -> Option<WaitHandleRef> {
|
pub fn make_wait_handle(&self, jid: InternalJobId) -> Option<WaitHandleRef> {
|
||||||
if !matches!(self.typ, ProcessType::External) || self.pid().is_none() {
|
let pid = self.pid()?;
|
||||||
// Not waitable.
|
if self.wait_handle.borrow().is_none() {
|
||||||
None
|
self.wait_handle.replace(Some(WaitHandle::new(
|
||||||
} else {
|
pid,
|
||||||
if self.wait_handle.borrow().is_none() {
|
jid,
|
||||||
self.wait_handle.replace(Some(WaitHandle::new(
|
wbasename(&self.actual_cmd.clone()).to_owned(),
|
||||||
self.pid().unwrap(),
|
)));
|
||||||
jid,
|
|
||||||
wbasename(&self.actual_cmd.clone()).to_owned(),
|
|
||||||
)));
|
|
||||||
}
|
|
||||||
self.get_wait_handle()
|
|
||||||
}
|
}
|
||||||
|
self.get_wait_handle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user