aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2020-08-15 05:33:35 -0500
committerRob Landley <rob@landley.net>2020-08-15 05:33:35 -0500
commit42303209f44a335025b9cd1dbe5dd2f3069f2e99 (patch)
tree59d1a5b7e6853b864f7fedecc9ef03f3d7356cbb
parentee63b5f474b2e32c70b43d0dad535b0006d350f7 (diff)
downloadtoybox-42303209f44a335025b9cd1dbe5dd2f3069f2e99.tar.gz
If we fflush(stdout) first we can just write to filehandle.
-rw-r--r--lib/xwrap.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/xwrap.c b/lib/xwrap.c
index 27473cf5..86905350 100644
--- a/lib/xwrap.c
+++ b/lib/xwrap.c
@@ -161,12 +161,8 @@ void xputsl(char *s, int len)
{
int out;
- while (len != (out = fwrite(s, 1, len, stdout))) {
- if (out<1) perror_exit("write");
- len -= out;
- s += out;
- }
xflush(0);
+ xwrite(0, s, len);
}
// xputs with no newline