Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Apr 2013 19:19:46 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r249063 - head/bin/dd
Message-ID:  <201304031919.r33JJkGL043939@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



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