cb9752b1a2
Co-authored-by: ayattara <alassane.yattara@savoirfairelinux.com> Co-authored-by: Carlos Florencio <carlosmflorencio@gmail.com>
18 lines
393 B
Go
18 lines
393 B
Go
//go:build !windows
|
|
|
|
package plugins
|
|
|
|
import "os"
|
|
|
|
// syncApprovalLedgerDirectory flushes the rename metadata on platforms that
|
|
// expose directory handles to fsync. The ledger file is already synced before
|
|
// the rename.
|
|
func syncApprovalLedgerDirectory(path string) error {
|
|
dir, err := os.Open(path)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
defer func() { _ = dir.Close() }()
|
|
return dir.Sync()
|
|
}
|