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).
This commit is contained in:
brooks 2013-04-03 19:19:45 +00:00
parent 02643447e4
commit e241794c89

View File

@ -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);
}