Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/timeout/timeout.v
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ fn handle_timeout(mut p os.Process, kill_after_ms i64, signal string, preserve_s
if verbose {
eprintln('${app_name}: sending signal ${signal} to command')
}
terminate_process(p, sig_num, !foreground)
terminate_process(mut &p, sig_num, !foreground)

if kill_after_ms > 0 {
kill_start := time.now()
Expand All @@ -263,7 +263,7 @@ fn handle_timeout(mut p os.Process, kill_after_ms i64, signal string, preserve_s
if verbose {
eprintln('${app_name}: sending signal KILL to command')
}
terminate_process(p, 9, !foreground)
terminate_process(mut &p, 9, !foreground)
}
return handle_process_exit(mut p, preserve_status, 124)
}
Expand Down
2 changes: 1 addition & 1 deletion src/timeout/timeout_default.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fn setup_process_group(p os.Process, foreground bool) {
// Fallback
}

fn terminate_process(p os.Process, sig_num int, process_group bool) {
fn terminate_process(mut p &os.Process, sig_num int, process_group bool) {
// Fallback: try to kill the process
p.signal_kill()
}
2 changes: 1 addition & 1 deletion src/timeout/timeout_nix.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn setup_process_group(p os.Process, foreground bool) {
}
}

fn terminate_process(p os.Process, sig_num int, process_group bool) {
fn terminate_process(mut p &os.Process, sig_num int, process_group bool) {
pid := if process_group { -p.pid } else { p.pid }
C.kill(pid, sig_num)
}
2 changes: 1 addition & 1 deletion src/timeout/timeout_windows.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fn setup_process_group(p os.Process, foreground bool) {
// A pointer, because signalling a process changes it. Passing it by value, as the
// nix version can, made the compiler reference it for us and then reject that as
// deprecated automatic referencing.
fn terminate_process(p os.Process, sig_num int, process_group bool) {
fn terminate_process(mut p &os.Process, sig_num int, process_group bool) {
// TERM, Windows doesn't seem to support signals like Unixes does
if sig_num == 15 {
p.signal_term()
Expand Down
Loading