commit 8c0e5435b32bfcd7e8a55cce9fc5b4ba70d1a148 (tree)
parent 32386a06caefc78dc3f0a2e6bb2cd478a4615bc3
Author: Jakub Konka <kubkon@jakubkonka.com>
Date: Thu, 8 Feb 2024 23:50:09 +0100
macho: do not close file on error - it will happen automatically anyhow
Diffstat:
1 file changed, 0 insertions(+), 2 deletions(-)
diff --git a/src/link/MachO.zig b/src/link/MachO.zig
@@ -957,7 +957,6 @@ fn parseObject(self: *MachO, path: []const u8) ParseError!void {
const gpa = self.base.comp.gpa;
const file = try std.fs.cwd().openFile(path, .{});
- errdefer file.close();
const handle = try self.addFileHandle(file);
const mtime: u64 = mtime: {
const stat = file.stat() catch break :mtime 0;
@@ -994,7 +993,6 @@ fn parseArchive(self: *MachO, lib: SystemLib, must_link: bool, fat_arch: ?fat.Ar
const gpa = self.base.comp.gpa;
const file = try std.fs.cwd().openFile(lib.path, .{});
- errdefer file.close();
const handle = try self.addFileHandle(file);
var archive = Archive{};