| ... | ... | @@ -646,7 +646,10 @@ pub fn Poller(comptime StreamEnum: type) type { |
| 646 | 646 | // always check if there's some data waiting to be read first. |
| 647 | 647 | if (poll_fd.revents & posix.POLL.IN != 0) { |
| 648 | 648 | const buf = try q.writableWithSize(bump_amt); |
| 649 | | const amt = try posix.read(poll_fd.fd, buf); |
| 649 | const amt = posix.read(poll_fd.fd, buf) catch |err| switch (err) { |
| 650 | error.BrokenPipe => 0, // Handle the same as EOF. |
| 651 | else => |e| return e, |
| 652 | }; |
| 650 | 653 | q.update(amt); |
| 651 | 654 | if (amt == 0) { |
| 652 | 655 | // Remove the fd when the EOF condition is met. |