Skip to content

Commit fb49753

Browse files
Chun Chen Hsudas
Chun Chen Hsu
authored andcommitted
handle EWOULDBLOCK error in _dispatch_operation_perform
POSIX.1-2001 allows either EAGAIN or EWOULDBLOCK to be returned when a write to a nonblocking socket would block. For example IBM z/OS returns EWOULDBLOCK for this case. Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
1 parent cff6bca commit fb49753

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/io.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2288,10 +2288,10 @@ _dispatch_operation_perform(dispatch_operation_t op)
22882288
return DISPATCH_OP_DELIVER;
22892289
}
22902290
error:
2291-
if (err == EAGAIN) {
2291+
if (err == EAGAIN || err == EWOULDBLOCK) {
22922292
// For disk based files with blocking I/O we should never get EAGAIN
22932293
dispatch_assert(!op->fd_entry->disk);
2294-
_dispatch_op_debug("performed: EAGAIN", op);
2294+
_dispatch_op_debug("performed: EAGAIN/EWOULDBLOCK", op);
22952295
if (op->direction == DOP_DIR_READ && op->total &&
22962296
op->channel == op->fd_entry->convenience_channel) {
22972297
// Convenience read with available data completes on EAGAIN

0 commit comments

Comments
 (0)