Commit a66c72749a

Andrew Kelley <andrew@ziglang.org>
2020-03-03 09:10:56
more macos fixes
1 parent 859fc85
Changed files (1)
lib
std
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 {