diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2013-04-23 16:08:24 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2013-04-23 16:08:24 +0000 |
commit | 6784d416a540e30a63721ddb48cc4ee3cbddf086 (patch) | |
tree | 4330c7945a4515fcf1e885c904d2052fd1dda811 /bin | |
parent | 5a6307cf42c5b4965435b3b7af74a37fd4dc17b9 (diff) | |
download | src-6784d416a540e30a63721ddb48cc4ee3cbddf086.tar.gz src-6784d416a540e30a63721ddb48cc4ee3cbddf086.zip |
Literally follow POSIX:
If the bs= expr operand is specified and no conversions other than sync,
noerror, or notrunc are requested, the data returned from each input
block shall be written as a separate output block.
In particular, when both bs=size and conv=sparce were specified, the
resulted file was fully filled, instead of sparce.
PR: standards/177742
Submitted by: Matthew Rezny <mrezny@hexaneinc.com>
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=249811
Diffstat (limited to 'bin')
-rw-r--r-- | bin/dd/dd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/dd/dd.c b/bin/dd/dd.c index 01b66fc2d5e5..9d0f9b1a3333 100644 --- a/bin/dd/dd.c +++ b/bin/dd/dd.c @@ -358,7 +358,7 @@ dd_in(void) * than noerror, notrunc or sync are specified, the block * is output without buffering as it is read. */ - if (ddflags & C_BS) { + if ((ddflags & ~(C_NOERROR | C_NOTRUNC | C_SYNC)) == C_BS) { out.dbcnt = in.dbcnt; dd_out(1); in.dbcnt = 0; |