Merge pull request #3127 from chengzhichao-xydt/codex/filesystem-dirfile-close
fix: explicitly ignore Close() errors on directory file descriptors
This commit is contained in:
commit
03b022c2ac
1 changed files with 1 additions and 1 deletions
|
|
@ -110,7 +110,7 @@ func WriteFileAtomic(path string, data []byte, perm os.FileMode) error {
|
|||
// This prevents the renamed file from disappearing after a crash
|
||||
if dirFile, err := os.Open(dir); err == nil {
|
||||
_ = dirFile.Sync()
|
||||
dirFile.Close()
|
||||
_ = dirFile.Close()
|
||||
}
|
||||
|
||||
// Success: skip cleanup (file was renamed, no temp to remove)
|
||||
|
|
|
|||
Loading…
Reference in a new issue