svn commit: r249063 - head/bin/dd
Brooks Davis
brooks at FreeBSD.org
Wed Apr 3 19:19:46 UTC 2013
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);
}
More information about the svn-src-head
mailing list