summaryrefslogtreecommitdiffstats
path: root/bin/dd/dd.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/dd/dd.c')
-rw-r--r--bin/dd/dd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/dd/dd.c b/bin/dd/dd.c
index 637e0cc..01b66fc 100644
--- a/bin/dd/dd.c
+++ b/bin/dd/dd.c
@@ -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);
}
OpenPOWER on IntegriCloud