From a66c72749a113cc6b2423d96d1f1f7c692d48ff5 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 3 Mar 2020 03:10:56 -0500 Subject: [PATCH] more macos fixes --- lib/std/os.zig | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/std/os.zig b/lib/std/os.zig index 8913a1599f5f843b544169a3f67f2d15832bdb9f..558dea4524569c5d9452602f003344eaff8b927d 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -3714,11 +3714,12 @@ pub fn sendfile( hdtr = &hdtr_data; } - const adjusted_count = math.min(count, max_count); + const adjusted_count = math.min(count, @as(u63, max_count)); while (true) { var sbytes: off_t = adjusted_count; - const err = errno(system.sendfile(out_fd, in_fd, in_offset, &sbytes, hdtr, flags)); + const signed_offset = @bitCast(i64, in_offset); + const err = errno(system.sendfile(out_fd, in_fd, signed_offset, &sbytes, hdtr, flags)); const amt = @bitCast(usize, sbytes); switch (err) { 0 => return amt, @@ -3745,7 +3746,7 @@ pub fn sendfile( EPIPE => return error.BrokenPipe, else => { - _ = unexpectedErrno(err); + const discard = unexpectedErrno(err); if (amt != 0) { return amt; } else { -- 2.54.0