aboutsummaryrefslogtreecommitdiff
path: root/lib/libc_r
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc_r')
-rw-r--r--lib/libc_r/uthread/uthread_write.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libc_r/uthread/uthread_write.c b/lib/libc_r/uthread/uthread_write.c
index 123a88e1e3c1..573e78e9e4d5 100644
--- a/lib/libc_r/uthread/uthread_write.c
+++ b/lib/libc_r/uthread/uthread_write.c
@@ -138,6 +138,8 @@ _write(int fd, const void *buf, size_t nbytes)
ret = num;
else
ret = n;
+ if (n == 0)
+ break;
/* Check if the write has completed: */
} else if (num >= nbytes)