compact: open src file readonly (#292)

pull/192/head^2
Peter Johnson 2022-01-29 03:37:59 +01:00 committed by GitHub
parent f84fe98fde
commit 9b8a60db84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1979,7 +1979,7 @@ func (cmd *CompactCommand) Run(args ...string) (err error) {
initialSize := fi.Size()
// Open source database.
src, err := bolt.Open(cmd.SrcPath, 0444, nil)
src, err := bolt.Open(cmd.SrcPath, 0444, &bolt.Options{ReadOnly: true})
if err != nil {
return err
}