Commit 356a2d7f authored by Brian Tiger Chow's avatar 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: default avatarBrian Tiger Chow <brian@perfmode.com>
parent 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 is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment