From 421fe128c3626ec102147e1df68d09207f202d6c Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Thu, 11 Dec 2014 13:09:50 -0500 Subject: [PATCH] Return Unknown instead of NotExist Unless the data dir truly does not exist. --- wal/util.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wal/util.go b/wal/util.go index 8d13f2137..0e940305b 100644 --- a/wal/util.go +++ b/wal/util.go @@ -37,7 +37,7 @@ const ( func DetectVersion(dirpath string) WalVersion { names, err := fileutil.ReadDir(dirpath) - if err != nil || len(names) == 0 { + if err != nil { return WALNotExist } nameSet := types.NewUnsafeSet(names...) @@ -46,7 +46,6 @@ func DetectVersion(dirpath string) WalVersion { if Exist(path.Join(dirpath, "wal")) { return WALv0_5 } - return WALNotExist } if nameSet.ContainsAll([]string{"snapshot", "conf", "log"}) { return WALv0_4