@cryptotaxi247 / kubo / commits / 356a2d7fa

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

@mappum @jbenet LGTU? License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

Brian Tiger Chow committed Nov 16, 2014 at 10:32 UTC 356a2d7faafbcbf4461f74020b490813c58f5c86
1 file changed +4
daemon2/daemon.go
+4
@@ -5,6 +5,7 @@ import (
5 "path"
6
7 lock "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/camlistore/lock"
8 + "github.com/jbenet/go-ipfs/util"
9 )
10
11 // LockFile is the filename of the daemon lock, relative to config dir
@@ -15,6 +16,9 @@ func Lock(confdir string) (io.Closer, error) {
16 }
17
18 func Locked(confdir string) bool {
19 + if !util.FileExists(path.Join(confdir, LockFile)) {
20 + return false
21 + }
22 if lk, err := Lock(confdir); err != nil {
23 return true
24