authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-10-19 22:16:27+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-10-22 07:59:23+02:00
logbc1e714de6377173257f0b1f01a85b1d18a35a19
tree8e772861ce4e538d5a975e5be54496fb9b613217
parent15f1e6a60c1b31a058e1a2f4638a1628b71d52a0

macho: revert changes to file descriptors mgmt


2 files changed, 3 insertions(+), 6 deletions(-)

src/link/MachO/Archive.zig+3-2
......@@ -3,7 +3,7 @@ const Archive = @This();
33const std = @import("std");
44const assert = std.debug.assert;
55const fs = std.fs;
6const log = std.log.scoped(.macho);
6const log = std.log.scoped(.link);
77const macho = std.macho;
88const mem = std.mem;
99
......@@ -88,6 +88,7 @@ const ar_hdr = extern struct {
8888};
8989
9090pub fn deinit(self: *Archive, allocator: Allocator) void {
91 self.file.close();
9192 for (self.toc.keys()) |*key| {
9293 allocator.free(key.*);
9394 }
......@@ -217,7 +218,7 @@ pub fn parseObject(
217218 const contents = try gpa.allocWithOptions(u8, object_size, @alignOf(u64), null);
218219 const amt = try reader.readAll(contents);
219220 if (amt != object_size) {
220 return error.Io;
221 return error.InputOutput;
221222 }
222223
223224 var object = Object{
src/link/MachO/zld.zig-4
......@@ -1420,10 +1420,6 @@ pub const Zld = struct {
14201420 pub fn deinit(self: *Zld) void {
14211421 const gpa = self.gpa;
14221422
1423 for (self.archives.items) |archive| {
1424 archive.file.close();
1425 }
1426
14271423 self.tlv_ptr_entries.deinit(gpa);
14281424 self.tlv_ptr_table.deinit(gpa);
14291425 self.got_entries.deinit(gpa);