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:
Mauro 2026-06-16 22:08:31 +02:00 committed by GitHub
commit 03b022c2ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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