提交 356a2d7f 作者: Brian Tiger Chow

fix(daemon) if lock file does not exist, then the lock is not acquired

@mappum @jbenet LGTU?

License: MIT
Signed-off-by: 's avatarBrian Tiger Chow <brian@perfmode.com>
上级 11fd2aa7
......@@ -5,6 +5,7 @@ import (
"path"
lock "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/camlistore/lock"
"github.com/jbenet/go-ipfs/util"
)
// LockFile is the filename of the daemon lock, relative to config dir
......@@ -15,6 +16,9 @@ func Lock(confdir string) (io.Closer, error) {
}
func Locked(confdir string) bool {
if !util.FileExists(path.Join(confdir, LockFile)) {
return false
}
if lk, err := Lock(confdir); err != nil {
return true
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论