From owner-svn-src-all@FreeBSD.ORG Thu Apr 3 04:46:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3B7D4C3; Thu, 3 Apr 2014 04:46:31 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 58AC76A2; Thu, 3 Apr 2014 04:46:30 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 2CDD878277F; Thu, 3 Apr 2014 15:46:21 +1100 (EST) Date: Thu, 3 Apr 2014 15:45:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Xin LI Subject: Re: svn commit: r264059 - head/bin/dd In-Reply-To: <201404030055.s330tGCI070764@svn.freebsd.org> Message-ID: <20140403150420.H959@besplex.bde.org> References: <201404030055.s330tGCI070764@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=eojmkOZX c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=pzt8HfeZUOQA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=Q1bsXHo6M8dLFd9smawA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 04:46:31 -0000 On Thu, 3 Apr 2014, Xin LI wrote: > Log: > Implement GNU's extension of 'status' operand. The GNU syntax is > borrowed where syntax status=noxfer means no transfer statistics > and status=none means no status information at all. > > This feature is useful because the statistics information can > sometimes be annoying, and redirecting stderr to /dev/null would > mean error messages also gets silenced. > > Obtained from: OpenBSD > MFC after: 2 weeks > ... > Modified: head/bin/dd/dd.h > ============================================================================== > --- head/bin/dd/dd.h Wed Apr 2 23:07:15 2014 (r264058) > +++ head/bin/dd/dd.h Thu Apr 3 00:55:16 2014 (r264059) > @@ -68,32 +68,35 @@ typedef struct { > } STAT; > > /* Flags (in ddflags). */ > -#define C_ASCII 0x00001 > -#define C_BLOCK 0x00002 The table should have been reformatted separately, or better not at all. > -#define C_BS 0x00004 > -#define C_CBS 0x00008 > -#define C_COUNT 0x00010 > -#define C_EBCDIC 0x00020 > -#define C_FILES 0x00040 > -#define C_IBS 0x00080 > -#define C_IF 0x00100 > -#define C_LCASE 0x00200 > -#define C_NOERROR 0x00400 > -#define C_NOTRUNC 0x00800 > -#define C_OBS 0x01000 > -#define C_OF 0x02000 > -#define C_OSYNC 0x04000 > -#define C_PAREVEN 0x08000 > -#define C_PARNONE 0x100000 The previous formatting was not too good, and obfuscated a bug here. 4 bits are unused. Someone added this bug together with many others in 2004, and I missed it then when I committed a fix for the others. Most of the bugs that I fixed were unsorting of the table by adding to its end. Insertion sort tends to give large churn of the table by changing all the numbers, but for the 2004 fix there wasn't much churn except relative to the unsorted version because all the changes were near the end. > -#define C_PARODD 0x200000 > -#define C_PARSET 0x400000 > -#define C_SEEK 0x800000 > -#define C_SKIP 0x1000000 > -#define C_SPARSE 0x2000000 > -#define C_SWAB 0x4000000 > -#define C_SYNC 0x8000000 > -#define C_UCASE 0x10000000 > -#define C_UNBLOCK 0x20000000 > -#define C_FILL 0x40000000 > +#define C_ASCII 0x000000001 > +#define C_BLOCK 0x000000002 > +#define C_BS 0x000000004 > +#define C_CBS 0x000000008 > +#define C_COUNT 0x000000010 > +#define C_EBCDIC 0x000000020 > +#define C_FILES 0x000000040 > +#define C_IBS 0x000000080 > +#define C_IF 0x000000100 > +#define C_LCASE 0x000000200 > +#define C_NOERROR 0x000000400 > +#define C_NOTRUNC 0x000000800 > +#define C_OBS 0x000001000 > +#define C_OF 0x000002000 > +#define C_OSYNC 0x000004000 > +#define C_PAREVEN 0x000008000 > +#define C_PARNONE 0x000100000 > +#define C_PARODD 0x000200000 > +#define C_PARSET 0x000400000 > +#define C_SEEK 0x000800000 > +#define C_SKIP 0x001000000 > +#define C_SPARSE 0x002000000 > +#define C_SWAB 0x004000000 > +#define C_SYNC 0x008000000 > +#define C_UCASE 0x010000000 > +#define C_UNBLOCK 0x020000000 Unsorting of the table continued from here after I stopped policing the order. > +#define C_FILL 0x040000000 > +#define C_STATUS 0x080000000 The above 2 unsorted entries are old, but reformatting in this commit obfuscates the change. > +#define C_NOXFER 0x100000000 > +#define C_NOINFO 0x200000000 Latest unsorting. The 2 values above UINT_MAX also won't compile with compilers that warn that 'integer constant is too large for "long" type'. Mainly gcc without -std=c99. clang is too incompatible to warn about this even with -std=c89 -Wall. The fix is not to further churn the table by adding a ULL suffix to all entries. > > #define C_PARITY (C_PAREVEN | C_PARODD | C_PARNONE | C_PARSET) > > Modified: head/bin/dd/extern.h > ============================================================================== > --- head/bin/dd/extern.h Wed Apr 2 23:07:15 2014 (r264058) > +++ head/bin/dd/extern.h Thu Apr 3 00:55:16 2014 (r264059) > @@ -53,7 +53,7 @@ extern STAT st; > extern void (*cfunc)(void); > extern uintmax_t cpy_cnt; > extern size_t cbsz; > -extern u_int ddflags; > +extern u_int64_t ddflags; Not needed when the unused bits in the first 32 are used. There are only 30 flags now. > extern uintmax_t files_cnt; > extern const u_char *ctab; > extern const u_char a2e_32V[], a2e_POSIX[]; > Bruce