Repository: lucy Updated Branches: refs/heads/master 555e275fb -> 8782bd56b
Check JSON type in LFLock_Maybe_Delete_File and fix test Project: http://git-wip-us.apache.org/repos/asf/lucy/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/51825fdb Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/51825fdb Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/51825fdb Branch: refs/heads/master Commit: 51825fdb5044de5ac8ff8c4081c3fa33db8801fb Parents: 555e275 Author: Nick Wellnhofer <[email protected]> Authored: Tue May 12 19:49:00 2015 +0200 Committer: Nick Wellnhofer <[email protected]> Committed: Tue May 12 19:49:00 2015 +0200 ---------------------------------------------------------------------- core/Lucy/Store/Lock.c | 6 ++++-- perl/t/305-indexer.t | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy/blob/51825fdb/core/Lucy/Store/Lock.c ---------------------------------------------------------------------- diff --git a/core/Lucy/Store/Lock.c b/core/Lucy/Store/Lock.c index 9c4acad..e4d868a 100644 --- a/core/Lucy/Store/Lock.c +++ b/core/Lucy/Store/Lock.c @@ -275,15 +275,17 @@ LFLock_Maybe_Delete_File_IMP(LockFileLock *self, String *path, if (hash != NULL && Obj_Is_A((Obj*)hash, HASH)) { String *pid_buf = (String*)Hash_Fetch_Utf8(hash, "pid", 3); String *host = (String*)Hash_Fetch_Utf8(hash, "host", 4); - String *name - = (String*)Hash_Fetch_Utf8(hash, "name", 4); + String *name = (String*)Hash_Fetch_Utf8(hash, "name", 4); // Match hostname and lock name. if (host != NULL + && Str_Is_A(host, STRING) && Str_Equals(host, (Obj*)ivars->host) && name != NULL + && Str_Is_A(name, STRING) && Str_Equals(name, (Obj*)ivars->name) && pid_buf != NULL + && Str_Is_A(pid_buf, STRING) ) { // Verify that pid is either mine or dead. int pid = (int)Str_To_I64(pid_buf); http://git-wip-us.apache.org/repos/asf/lucy/blob/51825fdb/perl/t/305-indexer.t ---------------------------------------------------------------------- diff --git a/perl/t/305-indexer.t b/perl/t/305-indexer.t index efa8b93..f133b1b 100644 --- a/perl/t/305-indexer.t +++ b/perl/t/305-indexer.t @@ -66,7 +66,7 @@ do { qq| { "host": "somebody_else", - "pid": $pid, + "pid": "$pid", "name": "write" }| );
