| ... | @@ -646,7 +646,10 @@ pub fn Poller(comptime StreamEnum: type) type { | ... | @@ -646,7 +646,10 @@ pub fn Poller(comptime StreamEnum: type) type { |
| 646 | // always check if there's some data waiting to be read first. | 646 | // always check if there's some data waiting to be read first. |
| 647 | if (poll_fd.revents & posix.POLL.IN != 0) { | 647 | if (poll_fd.revents & posix.POLL.IN != 0) { |
| 648 | const buf = try q.writableWithSize(bump_amt); | 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 | q.update(amt); | 653 | q.update(amt); |
| 651 | if (amt == 0) { | 654 | if (amt == 0) { |
| 652 | // Remove the fd when the EOF condition is met. | 655 | // Remove the fd when the EOF condition is met. |