commit 1d9b28403a1074cbbbd0605f07819136c9f96cdc (tree)
parent beae3cea178a0a93c25164e992e01c7b5b78e4d7
Author: LemonBoy <thatlemon@gmail.com>
Date: Sat, 12 Dec 2020 15:34:26 +0100
std: Correct check in signal test
Ooops.
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/std/os/test.zig b/lib/std/os/test.zig
@@ -656,14 +656,15 @@ test "sigaction" {
const S = struct {
fn handler(sig: i32, info: *const os.siginfo_t, ctx_ptr: ?*const c_void) callconv(.C) void {
// Check that we received the correct signal.
- signal_test_failed = info.signo == os.SIGUSR1;
+ if (sig == os.SIGUSR1 and sig == info.signo)
+ signal_test_failed = false;
}
};
var sa = os.Sigaction{
.sigaction = S.handler,
.mask = os.empty_sigset,
- .flags = os.SA_RESETHAND,
+ .flags = os.SA_SIGINFO | os.SA_RESETHAND,
};
var old_sa: os.Sigaction = undefined;
// Install the new signal handler.