summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2008-11-21 23:17:44 +0100
committerJim Meyering <meyering@redhat.com>2008-11-22 10:20:31 +0100
commitd5ab05998ca068b9a2e217285b15318ad2e5bdb8 (patch)
tree67b4c6ecdd6839fc0e47527676dbcc3a86124955 /src
parenta2be861b04f2bf8f967e7aa8683c813e7ebf5811 (diff)
downloadcoreutils-d5ab05998ca068b9a2e217285b15318ad2e5bdb8.tar.xz
Revert part of "dd: avoid unnecessary memory copies"
This reverts part of commit fbd87029cfc494a72bb73ade27ef46382c5bc832. Paul Eggert noticed the problem in http://lists.gnu.org/archive/html/bug-coreutils/2008-11/msg00153.html * doc/coreutils.texi (dd invocation): Clarify.
Diffstat (limited to 'src')
-rw-r--r--src/dd.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/dd.c b/src/dd.c
index e1e38e954..e54cc14df 100644
--- a/src/dd.c
+++ b/src/dd.c
@@ -455,7 +455,7 @@ Usage: %s [OPERAND]...\n\
fputs (_("\
Copy a file, converting and formatting according to the operands.\n\
\n\
- bs=BYTES force ibs=BYTES and obs=BYTES\n\
+ bs=BYTES read and write BYTES bytes at a time\n\
cbs=BYTES convert BYTES bytes at a time\n\
conv=CONVS convert the file as per the comma separated symbol list\n\
count=BLOCKS copy only BLOCKS input blocks\n\
@@ -1033,13 +1033,17 @@ scanargs (int argc, char *const *argv)
if (blocksize)
input_blocksize = output_blocksize = blocksize;
+ else
+ {
+ /* POSIX says dd aggregates short reads into
+ output_blocksize if bs= is not specified. */
+ conversions_mask |= C_TWOBUFS;
+ }
if (input_blocksize == 0)
input_blocksize = DEFAULT_BLOCKSIZE;
if (output_blocksize == 0)
output_blocksize = DEFAULT_BLOCKSIZE;
- if (input_blocksize != output_blocksize)
- conversions_mask |= C_TWOBUFS;
if (conversion_blocksize == 0)
conversions_mask &= ~(C_BLOCK | C_UNBLOCK);