Skip to content

Commit d6313ad

Browse files
Raise command signal to the current process
1 parent f518ec5 commit d6313ad

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

build_system/src/utils.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ use std::process::{Command, ExitStatus, Output};
1111

1212
#[cfg(unix)]
1313
unsafe extern "C" {
14-
fn raise(signal: c_int) -> c_int;
14+
fn kill(pid: c_int, signal: c_int) -> c_int;
15+
fn getpid() -> c_int;
1516
}
1617

1718
fn exec_command(
@@ -28,7 +29,7 @@ fn exec_command(
2829
{
2930
if let Some(signal) = status.signal() {
3031
unsafe {
31-
raise(signal as _);
32+
kill(getpid(), signal as _);
3233
}
3334
// In case the signal didn't kill the current process.
3435
return Err(command_error(input, &cwd, format!("Process received signal {}", signal)));

0 commit comments

Comments
 (0)