aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2019-05-19 02:35:28 -0500
committerRob Landley <rob@landley.net>2019-05-19 02:35:28 -0500
commite69d2fc6981b48fc46a7e9ae00962d309d5dabe4 (patch)
tree58339231b7ed841e792aac50c39669d1e1a2825a
parente35bd58a461d1d5ec38821dab702624f5f24608c (diff)
downloadtoybox-e69d2fc6981b48fc46a7e9ae00962d309d5dabe4.tar.gz
Don't complain about short writes to stdout.
-rw-r--r--lib/xwrap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/xwrap.c b/lib/xwrap.c
index e4f8f013..817037db 100644
--- a/lib/xwrap.c
+++ b/lib/xwrap.c
@@ -832,8 +832,10 @@ long long xsendfile_len(int in, int out, long long bytes)
{
long long len = sendfile_len(in, out, bytes, 0);
- if (bytes != -1 && bytes != len)
+ if (bytes != -1 && bytes != len) {
+ if (out == 1 && len<0) xexit();
error_exit("short %s", (len<0) ? "write" : "read");
+ }
return len;
}