Skip to content

Commit 2c9b221

Browse files
committed
Fix linux
1 parent 696538e commit 2c9b221

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/directfile/file_linux.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import (
66
"fmt"
77
"os"
88
"syscall"
9+
10+
"golang.org/x/sys/unix"
911
)
1012

1113
// OpenFileWithODirect Opens a file without system cache (DIRECT)
@@ -40,7 +42,7 @@ func OpenFileFADV_DONTNEED(path string) (*os.File, error) {
4042
// Use FADV_DONTNEED to suggest not caching pages
4143
err = unix.Fadvise(fd, 0, 0, unix.FADV_DONTNEED)
4244
if err != nil {
43-
return nil, fmt.Println("Error setting FADV_DONTNEED:", err)
45+
return nil, fmt.Errorf("error setting FADV_DONTNEED: %w", err)
4446
}
4547

4648
return file, nil

0 commit comments

Comments
 (0)