From 1d9b28403a1074cbbbd0605f07819136c9f96cdc Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sat, 12 Dec 2020 15:34:26 +0100 Subject: [PATCH] std: Correct check in signal test Ooops. --- lib/std/os/test.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/std/os/test.zig b/lib/std/os/test.zig index be0c718086..6c86f9322f 100644 --- 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.