authorgravatar for kkochis@outlook.comKen Kochis <kkochis@outlook.com> 2023-02-21 17:08:03-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-02-22 06:07:47-05:00
log436e99d13ba188412b8a431b69cc9ff29c6bec4a
tree9efc23027a0bdaa70535e3a9fb777d946d1b3bc2
parentb52be973dfb7d1408218b8e75800a2da3dc69108

Close files in hashFileFallible


1 files changed, 1 insertions(+), 0 deletions(-)

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