Merge pull request #10054 from tklauser/unix-syncfs

core/diff/apply: use unix.Syncfs
This commit is contained in:
Akihiro Suda 2024-04-10 10:18:47 +00:00 committed by GitHub
commit 27dfb0d09e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -97,9 +97,9 @@ func doSyncFs(file string) error {
} }
defer fd.Close() defer fd.Close()
_, _, errno := unix.Syscall(unix.SYS_SYNCFS, fd.Fd(), 0, 0) err = unix.Syncfs(int(fd.Fd()))
if errno != 0 { if err != nil {
return fmt.Errorf("failed to syncfs for %s: %w", file, errno) return fmt.Errorf("failed to syncfs for %s: %w", file, err)
} }
return nil return nil
} }