Skip to content

Commit

Permalink
use file.Sync() to flush data on linux platform
Browse files Browse the repository at this point in the history
Eventually file.Sync() calls syscall syscall.Fsync, which flushes
both data and metadata. While syscall.Fdatasync only flushes data.
So file.Sync is safer and it's more readable.

Signed-off-by: Benjamin Wang <[email protected]>
  • Loading branch information
ahrtr committed Nov 18, 2023
1 parent 33db274 commit 2b66a3d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
10 changes: 0 additions & 10 deletions bolt_linux.go

This file was deleted.

4 changes: 2 additions & 2 deletions boltsync_unix.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !windows && !plan9 && !linux && !openbsd
// +build !windows,!plan9,!linux,!openbsd
//go:build !windows && !plan9 && !openbsd
// +build !windows,!plan9,!openbsd

package bbolt

Expand Down

0 comments on commit 2b66a3d

Please sign in to comment.