Ignore EAGAIN in stderr dumps.

(Going out of the way to be sync)
pull/5370/head
Ryan Dahl 2010-02-09 14:42:56 -08:00
parent 88b9359284
commit 3eaaaffadb
1 changed files with 7 additions and 1 deletions

View File

@ -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;
}