mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 01:43:47 +00:00
check if os.Lstat(datadir) returns error in freezer.
This commit is contained in:
parent
9298074633
commit
97eb5dd796
1 changed files with 4 additions and 0 deletions
|
|
@ -87,6 +87,10 @@ func NewFreezer(datadir string, namespace string, readonly bool, maxTableSize ui
|
||||||
)
|
)
|
||||||
// Ensure the datadir is not a symbolic link if it exists.
|
// Ensure the datadir is not a symbolic link if it exists.
|
||||||
if info, err := os.Lstat(datadir); !os.IsNotExist(err) {
|
if info, err := os.Lstat(datadir); !os.IsNotExist(err) {
|
||||||
|
if err != nil {
|
||||||
|
log.Warn("error Lstat the database:", err)
|
||||||
|
return nil, errors.New("lstat failed")
|
||||||
|
}
|
||||||
if info == nil {
|
if info == nil {
|
||||||
log.Warn("Could not Lstat the database", "path", datadir)
|
log.Warn("Could not Lstat the database", "path", datadir)
|
||||||
return nil, errors.New("lstat failed")
|
return nil, errors.New("lstat failed")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue