From 160f7ed5f4e7bb9a9ebf315b897f2c845cd60ee0 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Thu, 4 Aug 2016 08:34:33 -0400 Subject: [PATCH] Use `setpgid` from libc. --- src/timeout/timeout.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/timeout/timeout.rs b/src/timeout/timeout.rs index 876e42fa3..2defbde26 100644 --- a/src/timeout/timeout.rs +++ b/src/timeout/timeout.rs @@ -20,10 +20,6 @@ use std::io::{ErrorKind, Write}; use std::process::{Command, Stdio}; use uucore::process::ChildExt; -extern { - pub fn setpgid(_: libc::pid_t, _: libc::pid_t) -> libc::c_int; -} - static NAME: &'static str = "timeout"; static VERSION: &'static str = env!("CARGO_PKG_VERSION"); @@ -96,7 +92,7 @@ Usage: fn timeout(cmdname: &str, args: &[String], duration: f64, signal: usize, kill_after: f64, foreground: bool, preserve_status: bool) -> i32 { if !foreground { - unsafe { setpgid(0, 0) }; + unsafe { libc::setpgid(0, 0) }; } let mut process = match Command::new(cmdname).args(args) .stdin(Stdio::inherit())