From 670ae8b5695852c6574d0e4b5b6eb08f50e6bd8d Mon Sep 17 00:00:00 2001 From: Chun Chen Hsu Date: Wed, 31 Aug 2016 13:59:14 +0900 Subject: [PATCH] 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. --- src/io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/io.c b/src/io.c index a4aca512d..0a00e6e63 100644 --- a/src/io.c +++ b/src/io.c @@ -2288,10 +2288,10 @@ _dispatch_operation_perform(dispatch_operation_t op) return DISPATCH_OP_DELIVER; } error: - if (err == EAGAIN) { + if (err == EAGAIN || err == EWOULDBLOCK) { // For disk based files with blocking I/O we should never get EAGAIN dispatch_assert(!op->fd_entry->disk); - _dispatch_op_debug("performed: EAGAIN", op); + _dispatch_op_debug("performed: EAGAIN/EWOULDBLOCK", op); if (op->direction == DOP_DIR_READ && op->total && op->channel == op->fd_entry->convenience_channel) { // Convenience read with available data completes on EAGAIN