diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-03-03 03:10:56 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-03-03 03:10:56 -0500 |
| commit | a66c72749a113cc6b2423d96d1f1f7c692d48ff5 (patch) | |
| tree | c07aed15cf52b4a4dda19858979652784200e127 /lib/std/os.zig | |
| parent | 859fc856d38860bbd8738d3a09527d8fcb7dcc7b (diff) | |
| download | zig-a66c72749a113cc6b2423d96d1f1f7c692d48ff5.tar.gz zig-a66c72749a113cc6b2423d96d1f1f7c692d48ff5.zip | |
more macos fixes
Diffstat (limited to 'lib/std/os.zig')
| -rw-r--r-- | lib/std/os.zig | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/std/os.zig b/lib/std/os.zig index 8913a1599f..558dea4524 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 { |
