std: Fix error in tlcsprng init sequence

The fallback case was actually switched with the success one.
This commit is contained in:
LemonBoy
2021-05-20 14:43:04 +02:00
parent 9910bfa6d8
commit 992c02ab95

View File

@@ -107,13 +107,9 @@ fn tlsCsprngFill(_: *const std.rand.Random, buffer: []u8) void {
break :wof;
} else |_| {}
os.madvise(
wipe_mem.ptr,
wipe_mem.len,
os.MADV_WIPEONFORK,
) catch {
if (os.madvise(wipe_mem.ptr, wipe_mem.len, os.MADV_WIPEONFORK)) |_| {
return initAndFill(buffer);
};
} else |_| {}
}
if (std.Thread.use_pthreads) {