Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Apr 2013 16:08:24 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r249811 - head/bin/dd
Message-ID:  <201304231608.r3NG8OQC090562@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Apr 23 16:08:24 2013
New Revision: 249811
URL: http://svnweb.freebsd.org/changeset/base/249811

Log:
  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

Modified:
  head/bin/dd/dd.c

Modified: head/bin/dd/dd.c
==============================================================================
--- head/bin/dd/dd.c	Tue Apr 23 14:36:44 2013	(r249810)
+++ head/bin/dd/dd.c	Tue Apr 23 16:08:24 2013	(r249811)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304231608.r3NG8OQC090562>