Created
November 2, 2019 17:12
-
-
Save bhansconnect/eab2a2cbcf43e3673a085b6928c91139 to your computer and use it in GitHub Desktop.
Zig compiler patch for https://github.com/andrewrk/zig-async-demo/pull/1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/std/os.zig b/lib/std/os.zig | |
index 988ab873d..58f74563e 100644 | |
--- a/lib/std/os.zig | |
+++ b/lib/std/os.zig | |
@@ -2997,7 +2997,7 @@ pub fn sendto( | |
while (true) { | |
const rc = system.sendto(sockfd, buf.ptr, buf.len, flags, dest_addr, addrlen); | |
switch (errno(rc)) { | |
- 0 => return rc, | |
+ 0 => return @intCast(usize, rc), | |
EACCES => return error.AccessDenied, | |
EAGAIN => if (std.event.Loop.instance) |loop| { | |
@@ -3063,7 +3063,7 @@ pub fn poll(fds: []pollfd, timeout: i32) PollError!usize { | |
while (true) { | |
const rc = system.poll(fds.ptr, fds.len, timeout); | |
switch (errno(rc)) { | |
- 0 => return rc, | |
+ 0 => return @intCast(usize, rc), | |
EFAULT => unreachable, | |
EINTR => continue, | |
EINVAL => unreachable, | |
@@ -3096,7 +3096,7 @@ pub fn recvfrom( | |
while (true) { | |
const rc = system.recvfrom(sockfd, buf.ptr, buf.len, flags, src_addr, addrlen); | |
switch (errno(rc)) { | |
- 0 => return rc, | |
+ 0 => return @intCast(usize, rc), | |
EBADF => unreachable, // always a race condition | |
EFAULT => unreachable, | |
EINVAL => unreachable, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment