mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 13:23:09 +00:00
Remove unnecessary Pid::get() calls
This commit is contained in:
parent
fc47d9fa1d
commit
4061ef7137
3 changed files with 6 additions and 9 deletions
|
@ -104,7 +104,7 @@ fn builtin_jobs_print(j: &Job, mode: JobsPrintMode, header: bool, streams: &mut
|
||||||
}
|
}
|
||||||
|
|
||||||
for p in j.external_procs() {
|
for p in j.external_procs() {
|
||||||
out += &sprintf!("%d\n", p.pid.load().unwrap().get())[..];
|
out += &sprintf!("%d\n", p.pid.load().unwrap())[..];
|
||||||
}
|
}
|
||||||
streams.out.append(out);
|
streams.out.append(out);
|
||||||
}
|
}
|
||||||
|
|
|
@ -881,7 +881,7 @@ fn exec_external_command(
|
||||||
exec_fork,
|
exec_fork,
|
||||||
"Fork #%d, pid %d: spawn external command '%s' from '%ls'",
|
"Fork #%d, pid %d: spawn external command '%s' from '%ls'",
|
||||||
count,
|
count,
|
||||||
pid.get(),
|
pid,
|
||||||
p.actual_cmd,
|
p.actual_cmd,
|
||||||
file.as_ref()
|
file.as_ref()
|
||||||
.map(|s| s.as_utfstr())
|
.map(|s| s.as_utfstr())
|
||||||
|
|
11
src/proc.rs
11
src/proc.rs
|
@ -1110,7 +1110,7 @@ impl Job {
|
||||||
} else {
|
} else {
|
||||||
charptr2wcstring(strsignal)
|
charptr2wcstring(strsignal)
|
||||||
};
|
};
|
||||||
wperror(&sprintf!("killpg(%d, %s)", pgid.get(), strsignal));
|
wperror(&sprintf!("killpg(%d, %s)", pgid, strsignal));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1502,13 +1502,10 @@ fn process_mark_finished_children(parser: &Parser, block_ok: bool) {
|
||||||
WNOHANG | WUNTRACED | WCONTINUED,
|
WNOHANG | WUNTRACED | WCONTINUED,
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
if pid <= 0 {
|
let Some(pid) = Pid::new(pid) else {
|
||||||
continue;
|
continue;
|
||||||
}
|
};
|
||||||
assert!(
|
assert!(pid == proc.pid().unwrap(), "Unexpected waitpid() return");
|
||||||
pid == proc.pid().unwrap().get(),
|
|
||||||
"Unexpected waitpid() return"
|
|
||||||
);
|
|
||||||
|
|
||||||
// The process has stopped or exited! Update its status.
|
// The process has stopped or exited! Update its status.
|
||||||
let status = ProcStatus::from_waitpid(statusv);
|
let status = ProcStatus::from_waitpid(statusv);
|
||||||
|
|
Loading…
Reference in a new issue