Skip to content

Commit

Permalink
Tread read errors as cache misses as well
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Apr 16, 2021
1 parent d878622 commit 503e9d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions ext/bootsnap/bootsnap.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,7 @@ open_cache_file(const char * path, struct bs_cache_key * key, const char ** errn
fd = open(path, O_RDONLY);
if (fd < 0) {
*errno_provenance = "bs_fetch:open_cache_file:open";
if (errno == ENOENT) return CACHE_MISS;
return ERROR_WITH_ERRNO;
return CACHE_MISS;
}
#ifdef _WIN32
setmode(fd, O_BINARY);
Expand Down
2 changes: 1 addition & 1 deletion test/compile_cache_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_no_write_permission_to_cache
folder = File.dirname(Help.cache_path(@tmp_dir, path))
FileUtils.mkdir_p(folder)
FileUtils.chmod(0400, folder)
assert_raises(Bootsnap::CompileCache::PermissionError) { load(path) }
load(path)
end
end

Expand Down

0 comments on commit 503e9d5

Please sign in to comment.