mirror of
https://github.com/taigrr/bitcask
synced 2025-01-18 04:03:17 -08:00
Fix paths used for temporary recovery iles to avoid crossing devices (#223)
Fixes #222 Co-authored-by: James Mills <prologic@shortcircuit.net.au> Reviewed-on: https://git.mills.io/prologic/bitcask/pulls/223 Co-authored-by: James Mills <prologic@noreply@mills.io> Co-committed-by: James Mills <prologic@noreply@mills.io>
This commit is contained in:
parent
52df2fad55
commit
a49bbf666a
@ -48,8 +48,8 @@ func recoverDatafile(path string, cfg *config.Config) (recovered bool, err error
|
|||||||
err = closeErr
|
err = closeErr
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
_, file := filepath.Split(path)
|
dir, file := filepath.Split(path)
|
||||||
rPath := fmt.Sprintf("%s.recovered", file)
|
rPath := filepath.Join(dir, fmt.Sprintf("%s.recovered", file))
|
||||||
fr, err := os.OpenFile(rPath, os.O_CREATE|os.O_WRONLY, os.ModePerm)
|
fr, err := os.OpenFile(rPath, os.O_CREATE|os.O_WRONLY, os.ModePerm)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, fmt.Errorf("creating the recovered datafile: %w", err)
|
return false, fmt.Errorf("creating the recovered datafile: %w", err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user