Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
util.c: add fsync_close() helper, use where appropriate
Using genimage directly on an eMMC on target, I'm seeing that the BLKRRPART ioctl fails with EBUSY, presumably because there's still lots of data in flight, and then subsequent parts of my bootstrap procedure fail because the expected partitions can't be found. Whenever we've written some data, we really should ensure that all data has hit the disk before proceeding, and close() itself is not synchronous. Add a fsync_close() helper that does exactly what it says on the tin. Use that wherever we close an fd that has been open for writing and actually written to (i.e., no point in doing that in the reload_partitions() function). Currently, the return value of these close() calls are ignored, so at least for now continue to do that, but at least we do see an error message in case something went wrong. Signed-off-by: Rasmus Villemoes <[email protected]>
- Loading branch information