From 42ae12b469ebc2ef985e419108a4ee10a7abd70b Mon Sep 17 00:00:00 2001 From: Gary Rong Date: Tue, 1 Jul 2025 11:45:50 +0800 Subject: [PATCH] triedb/pathdb: fix windows build issue --- .../{fileutils.go => fileutils_unix.go} | 3 +++ triedb/pathdb/fileutils_windows.go | 25 +++++++++++++++++++ 2 files changed, 28 insertions(+) rename triedb/pathdb/{fileutils.go => fileutils_unix.go} (97%) create mode 100644 triedb/pathdb/fileutils_windows.go diff --git a/triedb/pathdb/fileutils.go b/triedb/pathdb/fileutils_unix.go similarity index 97% rename from triedb/pathdb/fileutils.go rename to triedb/pathdb/fileutils_unix.go index 0247d336c6..fde0bf50fa 100644 --- a/triedb/pathdb/fileutils.go +++ b/triedb/pathdb/fileutils_unix.go @@ -14,6 +14,9 @@ // You should have received a copy of the GNU Lesser General Public License // along with the go-ethereum library. If not, see . +//go:build !windows +// +build !windows + package pathdb import ( diff --git a/triedb/pathdb/fileutils_windows.go b/triedb/pathdb/fileutils_windows.go new file mode 100644 index 0000000000..e4c644d757 --- /dev/null +++ b/triedb/pathdb/fileutils_windows.go @@ -0,0 +1,25 @@ +// Copyright 2025 The go-ethereum Authors +// This file is part of the go-ethereum library. +// +// The go-ethereum library is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// The go-ethereum library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the go-ethereum library. If not, see . + +//go:build windows +// +build windows + +package pathdb + +func syncDir(name string) error { + // On Windows, fsync on directories is not supported + return nil +}