Browse Source

pkg/transport: use TouchDirAll

Gyu-Ho Lee 9 years ago
parent
commit
4a0f922a6c
1 changed files with 2 additions and 1 deletions
  1. 2 1
      pkg/transport/listener.go

+ 2 - 1
pkg/transport/listener.go

@@ -31,6 +31,7 @@ import (
 	"strings"
 	"strings"
 	"time"
 	"time"
 
 
+	"github.com/coreos/etcd/pkg/fileutil"
 	"github.com/coreos/etcd/pkg/tlsutil"
 	"github.com/coreos/etcd/pkg/tlsutil"
 )
 )
 
 
@@ -101,7 +102,7 @@ func (info TLSInfo) Empty() bool {
 }
 }
 
 
 func SelfCert(dirpath string, hosts []string) (info TLSInfo, err error) {
 func SelfCert(dirpath string, hosts []string) (info TLSInfo, err error) {
-	if err = os.MkdirAll(dirpath, 0700); err != nil {
+	if err = fileutil.TouchDirAll(dirpath); err != nil {
 		return
 		return
 	}
 	}