diff options
Diffstat (limited to 'src/command')
-rw-r--r-- | src/command/async_process.rs | 9 | ||||
-rw-r--r-- | src/command/std.rs | 9 | ||||
-rw-r--r-- | src/command/tokio.rs | 9 |
3 files changed, 6 insertions, 21 deletions
diff --git a/src/command/async_process.rs b/src/command/async_process.rs index 0b5ceda..4c453e6 100644 --- a/src/command/async_process.rs +++ b/src/command/async_process.rs @@ -19,16 +19,11 @@ impl super::CommandImpl for async_process::Command { .stderr(unsafe { std::process::Stdio::from_raw_fd(stderr) }); } - fn pre_exec_impl<F>(&mut self, f: F) + unsafe fn pre_exec_impl<F>(&mut self, f: F) where F: FnMut() -> ::std::io::Result<()> + Send + Sync + 'static, { - // safe because setsid() and close() are async-signal-safe functions - // and ioctl() is a raw syscall (which is inherently - // async-signal-safe). - unsafe { - self.pre_exec(f); - } + self.pre_exec(f); } fn spawn_impl(&mut self) -> ::std::io::Result<Self::Child> { diff --git a/src/command/std.rs b/src/command/std.rs index b331fc0..3287834 100644 --- a/src/command/std.rs +++ b/src/command/std.rs @@ -19,16 +19,11 @@ impl super::CommandImpl for std::process::Command { .stderr(unsafe { std::process::Stdio::from_raw_fd(stderr) }); } - fn pre_exec_impl<F>(&mut self, f: F) + unsafe fn pre_exec_impl<F>(&mut self, f: F) where F: FnMut() -> ::std::io::Result<()> + Send + Sync + 'static, { - // safe because setsid() and close() are async-signal-safe functions - // and ioctl() is a raw syscall (which is inherently - // async-signal-safe). - unsafe { - self.pre_exec(f); - } + self.pre_exec(f); } fn spawn_impl(&mut self) -> ::std::io::Result<Self::Child> { diff --git a/src/command/tokio.rs b/src/command/tokio.rs index 338bc08..60dfb56 100644 --- a/src/command/tokio.rs +++ b/src/command/tokio.rs @@ -18,16 +18,11 @@ impl super::CommandImpl for tokio::process::Command { .stderr(unsafe { std::process::Stdio::from_raw_fd(stderr) }); } - fn pre_exec_impl<F>(&mut self, f: F) + unsafe fn pre_exec_impl<F>(&mut self, f: F) where F: FnMut() -> ::std::io::Result<()> + Send + Sync + 'static, { - // safe because setsid() and close() are async-signal-safe functions - // and ioctl() is a raw syscall (which is inherently - // async-signal-safe). - unsafe { - self.pre_exec(f); - } + self.pre_exec(f); } fn spawn_impl(&mut self) -> ::std::io::Result<Self::Child> { |