diff options
author | Rob Landley <rob@landley.net> | 2020-08-15 05:33:35 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2020-08-15 05:33:35 -0500 |
commit | 42303209f44a335025b9cd1dbe5dd2f3069f2e99 (patch) | |
tree | 59d1a5b7e6853b864f7fedecc9ef03f3d7356cbb /lib | |
parent | ee63b5f474b2e32c70b43d0dad535b0006d350f7 (diff) | |
download | toybox-42303209f44a335025b9cd1dbe5dd2f3069f2e99.tar.gz |
If we fflush(stdout) first we can just write to filehandle.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/xwrap.c | 6 |
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 |