diff options
author | Rob Landley <rob@landley.net> | 2019-05-19 02:35:28 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-05-19 02:35:28 -0500 |
commit | e69d2fc6981b48fc46a7e9ae00962d309d5dabe4 (patch) | |
tree | 58339231b7ed841e792aac50c39669d1e1a2825a /lib | |
parent | e35bd58a461d1d5ec38821dab702624f5f24608c (diff) | |
download | toybox-e69d2fc6981b48fc46a7e9ae00962d309d5dabe4.tar.gz |
Don't complain about short writes to stdout.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/xwrap.c | 4 |
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; } |