streamRequestTo: call f.Sync()

When calling reboot shortly after /update/*, the kernel should flush its cache,
but if you’re not calling reboot, it would be good to persist the data on disk
nevertheless.
This commit is contained in:
Michael Stapelberg 2018-07-13 23:16:26 +02:00
parent 0f8d40d7f6
commit 24c8ad07b5

View File

@ -83,6 +83,9 @@ func streamRequestTo(path string, r io.Reader) error {
if _, err := io.Copy(f, r); err != nil {
return err
}
if err := f.Sync(); err != nil {
return err
}
return f.Close()
}