authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-03-03 03:10:56-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-03-03 03:10:56-05:00
loga66c72749a113cc6b2423d96d1f1f7c692d48ff5
treec07aed15cf52b4a4dda19858979652784200e127
parent859fc856d38860bbd8738d3a09527d8fcb7dcc7b

more macos fixes


1 files changed, 4 insertions(+), 3 deletions(-)

lib/std/os.zig+4-3
......@@ -3714,11 +3714,12 @@ pub fn sendfile(
37143714 hdtr = &hdtr_data;
37153715 }
37163716
3717 const adjusted_count = math.min(count, max_count);
3717 const adjusted_count = math.min(count, @as(u63, max_count));
37183718
37193719 while (true) {
37203720 var sbytes: off_t = adjusted_count;
3721 const err = errno(system.sendfile(out_fd, in_fd, in_offset, &sbytes, hdtr, flags));
3721 const signed_offset = @bitCast(i64, in_offset);
3722 const err = errno(system.sendfile(out_fd, in_fd, signed_offset, &sbytes, hdtr, flags));
37223723 const amt = @bitCast(usize, sbytes);
37233724 switch (err) {
37243725 0 => return amt,
......@@ -3745,7 +3746,7 @@ pub fn sendfile(
37453746 EPIPE => return error.BrokenPipe,
37463747
37473748 else => {
3748 _ = unexpectedErrno(err);
3749 const discard = unexpectedErrno(err);
37493750 if (amt != 0) {
37503751 return amt;
37513752 } else {