mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: use TouchDirAll
This commit is contained in:
parent
ce50ee14d8
commit
d37e564eaa
@ -58,9 +58,6 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
// owner can make/remove files inside the directory
|
||||
privateDirMode = 0700
|
||||
|
||||
DefaultSnapCount = 10000
|
||||
|
||||
StoreClusterPrefix = "/0"
|
||||
@ -246,7 +243,7 @@ func NewServer(cfg *ServerConfig) (srv *EtcdServer, err error) {
|
||||
|
||||
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)
|
||||
}
|
||||
ss := snap.New(cfg.SnapDir())
|
||||
|
Loading…
x
Reference in New Issue
Block a user