authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-02-08 23:50:09+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-02-08 23:51:30+01:00
log8c0e5435b32bfcd7e8a55cce9fc5b4ba70d1a148
treed0d2f4faaa291be741ce8a6a19dff6e8c9bfd45e
parent32386a06caefc78dc3f0a2e6bb2cd478a4615bc3

macho: do not close file on error - it will happen automatically anyhow


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

src/link/MachO.zig-2
...@@ -957,7 +957,6 @@ fn parseObject(self: *MachO, path: []const u8) ParseError!void {...@@ -957,7 +957,6 @@ fn parseObject(self: *MachO, path: []const u8) ParseError!void {
957957
958 const gpa = self.base.comp.gpa;958 const gpa = self.base.comp.gpa;
959 const file = try std.fs.cwd().openFile(path, .{});959 const file = try std.fs.cwd().openFile(path, .{});
960 errdefer file.close();
961 const handle = try self.addFileHandle(file);960 const handle = try self.addFileHandle(file);
962 const mtime: u64 = mtime: {961 const mtime: u64 = mtime: {
963 const stat = file.stat() catch break :mtime 0;962 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...@@ -994,7 +993,6 @@ fn parseArchive(self: *MachO, lib: SystemLib, must_link: bool, fat_arch: ?fat.Ar
994 const gpa = self.base.comp.gpa;993 const gpa = self.base.comp.gpa;
995994
996 const file = try std.fs.cwd().openFile(lib.path, .{});995 const file = try std.fs.cwd().openFile(lib.path, .{});
997 errdefer file.close();
998 const handle = try self.addFileHandle(file);996 const handle = try self.addFileHandle(file);
999997
1000 var archive = Archive{};998 var archive = Archive{};