mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
start: fix logic for signal hanlding when SIG.POLL does not exist
fixes a compilation failure on FreeBSD
This commit is contained in:
parent
bbc1c07538
commit
ef55dcae67
@ -784,9 +784,19 @@ fn maybeIgnoreSignals() void {
|
|||||||
.mask = posix.sigemptyset(),
|
.mask = posix.sigemptyset(),
|
||||||
.flags = 0,
|
.flags = 0,
|
||||||
};
|
};
|
||||||
if (!std.options.keep_sigpoll) posix.sigaction(posix.SIG.POLL, &act, null);
|
|
||||||
if (@hasField(posix.SIG, "IO") and posix.SIG.IO != posix.SIG.POLL and !std.options.keep_sigio) posix.sigaction(posix.SIG.IO, &act, null);
|
if (@hasField(posix.SIG, "POLL") and !std.options.keep_sigpoll)
|
||||||
if (!std.options.keep_sigpipe) posix.sigaction(posix.SIG.PIPE, &act, null);
|
posix.sigaction(posix.SIG.POLL, &act, null);
|
||||||
|
|
||||||
|
if (@hasField(posix.SIG, "IO") and
|
||||||
|
(!@hasField(posix.SIG, "POLL") or posix.SIG.IO != posix.SIG.POLL) and
|
||||||
|
!std.options.keep_sigio)
|
||||||
|
{
|
||||||
|
posix.sigaction(posix.SIG.IO, &act, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (@hasField(posix.SIG, "PIPE") and !std.options.keep_sigpipe)
|
||||||
|
posix.sigaction(posix.SIG.PIPE, &act, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn noopSigHandler(_: i32) callconv(.c) void {}
|
fn noopSigHandler(_: i32) callconv(.c) void {}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user