From 3eaaaffadb85fd6187bdfaaffc6c0ab414a89a3a Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 9 Feb 2010 14:42:56 -0800 Subject: [PATCH] Ignore EAGAIN in stderr dumps. (Going out of the way to be sync) --- src/node_stdio.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/node_stdio.cc b/src/node_stdio.cc index cda79e3..2b5b306 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; } -- 2.7.4