mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-05-28 04:04:39 -04:00
Merge pull request #52125 from yujuhong/fix-file-sync
Automatic merge from submit-queue (batch tested with PRs 52339, 52343, 52125, 52360, 52301) dockershim: check if f.Sync() returns an error and surface it ```release-note dockershim: check the error when syncing the checkpoint. ```
This commit is contained in:
commit
c6a9b1e198
1 changed files with 4 additions and 1 deletions
|
|
@ -76,7 +76,10 @@ func writeFileAndSync(filename string, data []byte, perm os.FileMode) error {
|
|||
if err == nil && n < len(data) {
|
||||
err = io.ErrShortWrite
|
||||
}
|
||||
f.Sync()
|
||||
if err == nil {
|
||||
// Only sync if the Write completed successfully.
|
||||
err = f.Sync()
|
||||
}
|
||||
if err1 := f.Close(); err == nil {
|
||||
err = err1
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue