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(...@@ -3714,11 +3714,12 @@ pub fn sendfile(
3714 hdtr = &hdtr_data;3714 hdtr = &hdtr_data;
3715 }3715 }
37163716
3717 const adjusted_count = math.min(count, max_count);3717 const adjusted_count = math.min(count, @as(u63, max_count));
37183718
3719 while (true) {3719 while (true) {
3720 var sbytes: off_t = adjusted_count;3720 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));
3722 const amt = @bitCast(usize, sbytes);3723 const amt = @bitCast(usize, sbytes);
3723 switch (err) {3724 switch (err) {
3724 0 => return amt,3725 0 => return amt,
...@@ -3745,7 +3746,7 @@ pub fn sendfile(...@@ -3745,7 +3746,7 @@ pub fn sendfile(
3745 EPIPE => return error.BrokenPipe,3746 EPIPE => return error.BrokenPipe,
37463747
3747 else => {3748 else => {
3748 _ = unexpectedErrno(err);3749 const discard = unexpectedErrno(err);
3749 if (amt != 0) {3750 if (amt != 0) {
3750 return amt;3751 return amt;
3751 } else {3752 } else {