From 3d1fae8ce0c6fd8d3f8223dfee9b9ebbefadf635 Mon Sep 17 00:00:00 2001 From: Connor Edwards <38229097+cedws@users.noreply.github.com> Date: Sat, 15 Aug 2020 05:51:01 +0100 Subject: [PATCH] Fix failure to open locked DB in read-only mode on Windows (#316) Co-authored-by: Connor Edwards <38229097+c-edw@users.noreply.github.com> --- leveldb/storage/file_storage_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/leveldb/storage/file_storage_windows.go b/leveldb/storage/file_storage_windows.go index 899335fd..9bb33f27 100644 --- a/leveldb/storage/file_storage_windows.go +++ b/leveldb/storage/file_storage_windows.go @@ -37,7 +37,7 @@ func newFileLock(path string, readOnly bool) (fl fileLock, err error) { var access, shareMode uint32 if readOnly { access = syscall.GENERIC_READ - shareMode = syscall.FILE_SHARE_READ + shareMode = syscall.FILE_SHARE_READ | syscall.FILE_SHARE_WRITE } else { access = syscall.GENERIC_READ | syscall.GENERIC_WRITE }