diff --git a/src/node_stdio.cc b/src/node_stdio.cc index cda79e3a9..2b5b30612 100644 --- a/src/node_stdio.cc +++ b/src/node_stdio.cc @@ -68,7 +68,13 @@ WriteError (const Arguments& args) size_t written = 0; while (written < msg.length()) { r = write(STDERR_FILENO, (*msg) + written, msg.length() - written); - if (r < 0) return ThrowException(errno_exception(errno)); + if (r < 0) { + if (errno == EAGAIN || errno == EIO) { + usleep(100); + continue; + } + return ThrowException(errno_exception(errno)); + } written += (size_t)r; }