From c568e81b8f4e488590ce470487e671f615491e59 Mon Sep 17 00:00:00 2001 From: deischen Date: Mon, 29 Sep 2003 13:41:26 +0000 Subject: If __sys_write() returns 0, allow that to exit the loop in libc_r's wrapped version of write(). Submitted by: dan@langille.org --- lib/libc_r/uthread/uthread_write.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/libc_r/uthread/uthread_write.c b/lib/libc_r/uthread/uthread_write.c index 85ef9eb..123a88e 100644 --- a/lib/libc_r/uthread/uthread_write.c +++ b/lib/libc_r/uthread/uthread_write.c @@ -95,7 +95,7 @@ _write(int fd, const void *buf, size_t nbytes) * write: */ if (blocking && ((n < 0 && (errno == EWOULDBLOCK || - errno == EAGAIN)) || (n >= 0 && num < nbytes))) { + errno == EAGAIN)) || (n > 0 && num < nbytes))) { curthread->data.fd.fd = fd; _thread_kern_set_timeout(NULL); @@ -133,7 +133,7 @@ _write(int fd, const void *buf, size_t nbytes) * If there was an error, return partial success * (if any bytes were written) or else the error: */ - } else if (n < 0) { + } else if (n <= 0) { if (num > 0) ret = num; else -- cgit v1.1