diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2019-10-11 14:11:44 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2019-10-11 14:11:44 +0200 |
commit | 42f454b13b8d972e85acd7f046065ec69af4d206 (patch) | |
tree | 2cc09f3970a5115bee0fccda3c558a1e9211660f /libbb | |
parent | 7011eca83afc313098f9869eea36742d4506bc02 (diff) | |
download | busybox-w32-42f454b13b8d972e85acd7f046065ec69af4d206.tar.gz busybox-w32-42f454b13b8d972e85acd7f046065ec69af4d206.tar.bz2 busybox-w32-42f454b13b8d972e85acd7f046065ec69af4d206.zip |
dpkg-deb: work around bogus error message when working with XZ compressed packages
function old new delta
unpack_xz_stream 2309 2317 +8
bb_full_fd_action 464 472 +8
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/copyfd.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libbb/copyfd.c b/libbb/copyfd.c index ae5c26999..d41fd10f0 100644 --- a/libbb/copyfd.c +++ b/libbb/copyfd.c | |||
@@ -18,7 +18,7 @@ | |||
18 | * was seen to cause largish delays when user tries to ^C a file copy. | 18 | * was seen to cause largish delays when user tries to ^C a file copy. |
19 | * Let's use a saner size. | 19 | * Let's use a saner size. |
20 | * Note: needs to be >= max(CONFIG_FEATURE_COPYBUF_KB), | 20 | * Note: needs to be >= max(CONFIG_FEATURE_COPYBUF_KB), |
21 | * or else "copy to eof" code will use neddlesly short reads. | 21 | * or else "copy to eof" code will use needlesly short reads. |
22 | */ | 22 | */ |
23 | #define SENDFILE_BIGBUF (16*1024*1024) | 23 | #define SENDFILE_BIGBUF (16*1024*1024) |
24 | 24 | ||
@@ -60,10 +60,13 @@ static off_t bb_full_fd_action(int src_fd, int dst_fd, off_t size) | |||
60 | ssize_t rd; | 60 | ssize_t rd; |
61 | 61 | ||
62 | if (sendfile_sz) { | 62 | if (sendfile_sz) { |
63 | rd = sendfile(dst_fd, src_fd, NULL, | 63 | /* dst_fd == -1 is a fake, else... */ |
64 | size > sendfile_sz ? sendfile_sz : size); | 64 | if (dst_fd >= 0) { |
65 | if (rd >= 0) | 65 | rd = sendfile(dst_fd, src_fd, NULL, |
66 | goto read_ok; | 66 | size > sendfile_sz ? sendfile_sz : size); |
67 | if (rd >= 0) | ||
68 | goto read_ok; | ||
69 | } | ||
67 | sendfile_sz = 0; /* do not try sendfile anymore */ | 70 | sendfile_sz = 0; /* do not try sendfile anymore */ |
68 | } | 71 | } |
69 | #if CONFIG_FEATURE_COPYBUF_KB > 4 | 72 | #if CONFIG_FEATURE_COPYBUF_KB > 4 |