core/diff/apply: use unix.Syncfs
Use the Syncfs wrapper function defined in the golang.org/x/sys/unix package instead of manually wrapping it in doSyncFs. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
This commit is contained in:
parent
406e9e84b4
commit
0ec14fdf8c
@ -97,9 +97,9 @@ func doSyncFs(file string) error {
|
||||
}
|
||||
defer fd.Close()
|
||||
|
||||
_, _, errno := unix.Syscall(unix.SYS_SYNCFS, fd.Fd(), 0, 0)
|
||||
if errno != 0 {
|
||||
return fmt.Errorf("failed to syncfs for %s: %w", file, errno)
|
||||
err = unix.Syncfs(int(fd.Fd()))
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to syncfs for %s: %w", file, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user