Skip to content

Commit 44bfa18

Browse files
committed
doc: Update doc
1 parent e53ccf5 commit 44bfa18

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/sys/signal.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,8 +682,12 @@ pub fn kill<T: Into<Option<Signal>>>(pid: ::unistd::Pid, signal: T) -> Result<()
682682

683683
/// Send a signal to a process group [(see
684684
/// killpg(3))](http://pubs.opengroup.org/onlinepubs/9699919799/functions/killpg.html).
685-
pub fn killpg<T: Into<Option<Signal>>>(pid: ::unistd::Pid, signal: T) -> Result<()> {
686-
let res = unsafe { libc::killpg(pid.into(),
685+
///
686+
/// If `pgrp` less then or equal 1, the behavior is undefined.
687+
/// If `signal` is `None`, `killpg` will only preform error checking and won't
688+
/// send any signal.
689+
pub fn killpg<T: Into<Option<Signal>>>(pgrp: ::unistd::Pid, signal: T) -> Result<()> {
690+
let res = unsafe { libc::killpg(pgrp.into(),
687691
match signal.into() {
688692
Some(s) => s as libc::c_int,
689693
None => 0,

test/sys/test_signal.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ fn test_kill_none() {
1111

1212
#[test]
1313
fn test_killpg_none() {
14-
killpg(getpgrp(), None).expect("Should be able to send signal to my process group.");
14+
killpg(getpgrp(), None)
15+
.expect("Should be able to send signal to my process group.");
1516
}
1617

1718
#[test]

0 commit comments

Comments
 (0)