Skip to content

Commit 37b2b15

Browse files
committed
implement necessary things for std
1 parent ee80725 commit 37b2b15

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

src/std/core.rs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,7 @@ pub trait StdChildWrapper: Any + std::fmt::Debug + Send {
205205
/// and unwrapped processes.
206206
#[cfg(unix)]
207207
fn signal(&self, sig: i32) -> Result<()> {
208-
kill(
209-
Pid::from_raw(i32::try_from(self.id()).map_err(std::io::Error::other)?),
210-
Signal::try_from(sig)?,
211-
)
212-
.map_err(std::io::Error::from)
208+
self.inner().signal(sig)
213209
}
214210
}
215211

@@ -240,6 +236,23 @@ impl StdChildWrapper for StdChild {
240236
fn stderr(&mut self) -> &mut Option<ChildStderr> {
241237
&mut self.0.stderr
242238
}
239+
fn id(&self) -> u32 {
240+
self.0.id()
241+
}
242+
fn try_wait(&mut self) -> Result<Option<ExitStatus>> {
243+
self.0.try_wait()
244+
}
245+
fn wait(&mut self) -> Result<ExitStatus> {
246+
self.0.wait()
247+
}
248+
#[cfg(unix)]
249+
fn signal(&self, sig: i32) -> Result<()> {
250+
kill(
251+
Pid::from_raw(i32::try_from(self.id()).map_err(std::io::Error::other)?),
252+
Signal::try_from(sig)?,
253+
)
254+
.map_err(std::io::Error::from)
255+
}
243256
}
244257

245258
impl dyn StdChildWrapper {

0 commit comments

Comments
 (0)