From owner-svn-src-all@FreeBSD.ORG Wed Apr 3 19:19:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3EA077BC; Wed, 3 Apr 2013 19:19:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 318F895D; Wed, 3 Apr 2013 19:19:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r33JJkr7043940; Wed, 3 Apr 2013 19:19:46 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r33JJkGL043939; Wed, 3 Apr 2013 19:19:46 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304031919.r33JJkGL043939@svn.freebsd.org> From: Brooks Davis Date: Wed, 3 Apr 2013 19:19:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249063 - head/bin/dd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 03 Apr 2013 19:19:46 -0000 Author: brooks Date: Wed Apr 3 19:19:45 2013 New Revision: 249063 URL: http://svnweb.freebsd.org/changeset/base/249063 Log: IFP4 change 222074. Introduce an explicit close of the output descriptor so that work done on close is accounted for in the summary output triggered at exit (implicit close()s occur after atexit() hooks). This is useful because some devices such as cfi(4) may perform signficant work after a close occurs (e.g. erasing and rewriting a block of flash). Modified: head/bin/dd/dd.c Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Wed Apr 3 18:30:09 2013 (r249062) +++ head/bin/dd/dd.c Wed Apr 3 19:19:45 2013 (r249063) @@ -98,6 +98,13 @@ main(int argc __unused, char *argv[]) dd_in(); dd_close(); + /* + * Some devices such as cfi(4) may perform significant amounts + * of work when a write descriptor is closed. Close the out + * descriptor explicitly so that the summary handler (called + * from an atexit() hook) includes this work. + */ + close(out.fd); exit(0); }