Skip to content

Commit

Permalink
std.process.Child: fix sigaction error
Browse files Browse the repository at this point in the history
  • Loading branch information
ruihe774 committed Dec 31, 2024
1 parent da0b966 commit 27e8236
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/std/process/Child.zig
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,10 @@ fn spawnPosixChildHelper(arg: usize) callconv(.c) u8 {
}
var old_act: posix.Sigaction = undefined;
const new_act = mem.zeroes(posix.Sigaction);
posix.sigaction(@intCast(sig), &new_act, &old_act);
// Do not use posix.sigaction. It reaches unreachable.
_ = linux.sigaction(@intCast(sig), &new_act, &old_act);
if (old_act.handler.handler == linux.SIG.IGN) {
posix.sigaction(@intCast(sig), &old_act, null);
_ = linux.sigaction(@intCast(sig), &old_act, null);
}
}
posix.sigprocmask(posix.SIG.SETMASK, child_arg.sigmask, null);
Expand Down

0 comments on commit 27e8236

Please sign in to comment.