Skip to content

Commit 27dfb0d

Browse files
authored
Merge pull request containerd#10054 from tklauser/unix-syncfs
core/diff/apply: use unix.Syncfs
2 parents a68f9b7 + 0ec14fd commit 27dfb0d

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)