Merge pull request #5714 from gyuho/wal_dir

*: use fileutil.TouchDirAll
This commit is contained in:
Gyu-Ho Lee 2016-06-19 12:02:46 -07:00 committed by GitHub
commit 23621387fc

View File

@ -58,9 +58,6 @@ import (
) )
const ( const (
// owner can make/remove files inside the directory
privateDirMode = 0700
DefaultSnapCount = 10000 DefaultSnapCount = 10000
StoreClusterPrefix = "/0" StoreClusterPrefix = "/0"
@ -246,7 +243,7 @@ func NewServer(cfg *ServerConfig) (srv *EtcdServer, err error) {
haveWAL := wal.Exist(cfg.WALDir()) haveWAL := wal.Exist(cfg.WALDir())
if err = os.MkdirAll(cfg.SnapDir(), privateDirMode); err != nil && !os.IsExist(err) { if err = fileutil.TouchDirAll(cfg.SnapDir()); err != nil {
plog.Fatalf("create snapshot directory error: %v", err) plog.Fatalf("create snapshot directory error: %v", err)
} }
ss := snap.New(cfg.SnapDir()) ss := snap.New(cfg.SnapDir())