From ad9d5133653da97c82df0f68a794e0ffa33ac8f7 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 30 Dec 2021 18:31:27 -0500 Subject: Revert "add spawn_pg" This reverts commit 43e517cea6704f0d8424a88b13a1d40550c7e9ca. --- src/command.rs | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'src/command.rs') diff --git a/src/command.rs b/src/command.rs index c6dac9d..cd1c8a3 100644 --- a/src/command.rs +++ b/src/command.rs @@ -128,30 +128,6 @@ impl Command { Ok(self.inner.spawn()?) } - pub fn spawn_pg( - &mut self, - pg: Option, - ) -> crate::Result { - let mut set_process_group = crate::sys::set_process_group_child(pg); - // Safety: setpgid() is an async-signal-safe function and ioctl() is a - // raw syscall (which is inherently async-signal-safe). - if let Some(mut custom) = self.pre_exec.take() { - unsafe { - self.inner.pre_exec(move || { - set_process_group()?; - custom()?; - Ok(()) - }) - }; - } else { - unsafe { self.inner.pre_exec(set_process_group) }; - } - - let child = self.inner.spawn()?; - crate::sys::set_process_group_parent(child.id(), pg)?; - Ok(child) - } - pub fn uid(&mut self, id: u32) -> &mut Self { self.inner.uid(id); self -- cgit v1.2.3-54-g00ecf