From 0ec14fdf8cdfb449d2834a0fdc3d8f58fe70bd9c Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 9 Apr 2024 15:12:43 +0200 Subject: [PATCH] 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 --- core/diff/apply/apply_linux.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/diff/apply/apply_linux.go b/core/diff/apply/apply_linux.go index c43b071b4..e4f4fc44a 100644 --- a/core/diff/apply/apply_linux.go +++ b/core/diff/apply/apply_linux.go @@ -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 }