Close files in hashFileFallible

This commit is contained in:
Ken Kochis 2023-02-21 17:08:03 -08:00 committed by Andrew Kelley
parent b52be973df
commit 436e99d13b

View file

@ -625,6 +625,7 @@ fn workerHashFile(dir: fs.Dir, hashed_file: *HashedFile, wg: *WaitGroup) void {
fn hashFileFallible(dir: fs.Dir, hashed_file: *HashedFile) HashedFile.Error!void { fn hashFileFallible(dir: fs.Dir, hashed_file: *HashedFile) HashedFile.Error!void {
var buf: [8000]u8 = undefined; var buf: [8000]u8 = undefined;
var file = try dir.openFile(hashed_file.path, .{}); var file = try dir.openFile(hashed_file.path, .{});
defer file.close();
var hasher = Manifest.Hash.init(.{}); var hasher = Manifest.Hash.init(.{});
hasher.update(hashed_file.path); hasher.update(hashed_file.path);
hasher.update(&.{ 0, @boolToInt(try isExecutable(file)) }); hasher.update(&.{ 0, @boolToInt(try isExecutable(file)) });