Skip to content

Commit 0ec14fd

Browse files
committed
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 <[email protected]>
1 parent 406e9e8 commit 0ec14fd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/diff/apply/apply_linux.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ func doSyncFs(file string) error {
9797
}
9898
defer fd.Close()
9999

100-
_, _, errno := unix.Syscall(unix.SYS_SYNCFS, fd.Fd(), 0, 0)
101-
if errno != 0 {
102-
return fmt.Errorf("failed to syncfs for %s: %w", file, errno)
100+
err = unix.Syncfs(int(fd.Fd()))
101+
if err != nil {
102+
return fmt.Errorf("failed to syncfs for %s: %w", file, err)
103103
}
104104
return nil
105105
}

0 commit comments

Comments
 (0)