fix cache hash regression

fixes "warning: unexpected seek failure"

fix regression introduced by 27e31f04758d95cb7cf51a74e2a3903553ce3bc5

the fd should be closed only if returning with an error
This commit is contained in:
Andrew Kelley 2019-04-02 15:29:16 -04:00
parent 0cccba71d4
commit 2f96c55095

View File

@ -437,7 +437,9 @@ Error cache_hit(CacheHash *ch, Buf *out_digest) {
return ErrorCacheUnavailable;
}
}
os_file_close(ch->manifest_file);
if (return_code != ErrorNone) {
os_file_close(ch->manifest_file);
}
return return_code;
}
// Cache Hit