mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:24:33 +01:00
std.Io.Threaded: fix 32-bit overflow in lookupDns
be a little more careful with nanoseconds
This commit is contained in:
parent
c8739d6953
commit
cc4931b325
1 changed files with 1 additions and 1 deletions
|
|
@ -5235,7 +5235,7 @@ fn lookupDns(
|
|||
var now_ts = try clock.now(t_io);
|
||||
const final_ts = now_ts.addDuration(.fromSeconds(rc.timeout_seconds));
|
||||
const attempt_duration: Io.Duration = .{
|
||||
.nanoseconds = std.time.ns_per_s * @as(usize, rc.timeout_seconds) / rc.attempts,
|
||||
.nanoseconds = (std.time.ns_per_s / rc.attempts) * @as(i96, rc.timeout_seconds),
|
||||
};
|
||||
|
||||
send: while (now_ts.nanoseconds < final_ts.nanoseconds) : (now_ts = try clock.now(t_io)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue