aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-06-26 23:08:59 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-06-26 23:08:59 +0200
commit1eaf7e76bfff22646baf7d815650106e64ba0691 (patch)
tree2bf1a36260491642583c7a422256f370bc238c59
parentfd33e17a2bf4c09bb12ac09a645cfd0f0f914fec (diff)
downloadbusybox-1eaf7e76bfff22646baf7d815650106e64ba0691.tar.gz
libbb/copyfd.c: fix the case of copy buffer <= 4kb
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--libbb/copyfd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libbb/copyfd.c b/libbb/copyfd.c
index 2538d496d..82622c06f 100644
--- a/libbb/copyfd.c
+++ b/libbb/copyfd.c
@@ -17,19 +17,21 @@ static off_t bb_full_fd_action(int src_fd, int dst_fd, off_t size)
{
int status = -1;
off_t total = 0;
+ bool continue_on_write_error = 0;
#if CONFIG_FEATURE_COPYBUF_KB <= 4
char buffer[CONFIG_FEATURE_COPYBUF_KB * 1024];
enum { buffer_size = sizeof(buffer) };
#else
char *buffer;
int buffer_size;
- bool continue_on_write_error = 0;
+#endif
if (size < 0) {
size = -size;
continue_on_write_error = 1;
}
+#if CONFIG_FEATURE_COPYBUF_KB > 4
if (size > 0 && size <= 4 * 1024)
goto use_small_buf;
/* We want page-aligned buffer, just in case kernel is clever