Skip to content

Commit 2f96c55

Browse files
committed
fix cache hash regression
fixes "warning: unexpected seek failure" fix regression introduced by 27e31f0 the fd should be closed only if returning with an error
1 parent 0cccba7 commit 2f96c55

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/cache_hash.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,9 @@ Error cache_hit(CacheHash *ch, Buf *out_digest) {
437437
return ErrorCacheUnavailable;
438438
}
439439
}
440-
os_file_close(ch->manifest_file);
440+
if (return_code != ErrorNone) {
441+
os_file_close(ch->manifest_file);
442+
}
441443
return return_code;
442444
}
443445
// Cache Hit

0 commit comments

Comments
 (0)