mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 16:54:52 +00:00
macho: revert changes to file descriptors mgmt
This commit is contained in:
parent
15f1e6a60c
commit
bc1e714de6
@ -3,7 +3,7 @@ const Archive = @This();
|
||||
const std = @import("std");
|
||||
const assert = std.debug.assert;
|
||||
const fs = std.fs;
|
||||
const log = std.log.scoped(.macho);
|
||||
const log = std.log.scoped(.link);
|
||||
const macho = std.macho;
|
||||
const mem = std.mem;
|
||||
|
||||
@ -88,6 +88,7 @@ const ar_hdr = extern struct {
|
||||
};
|
||||
|
||||
pub fn deinit(self: *Archive, allocator: Allocator) void {
|
||||
self.file.close();
|
||||
for (self.toc.keys()) |*key| {
|
||||
allocator.free(key.*);
|
||||
}
|
||||
@ -217,7 +218,7 @@ pub fn parseObject(
|
||||
const contents = try gpa.allocWithOptions(u8, object_size, @alignOf(u64), null);
|
||||
const amt = try reader.readAll(contents);
|
||||
if (amt != object_size) {
|
||||
return error.Io;
|
||||
return error.InputOutput;
|
||||
}
|
||||
|
||||
var object = Object{
|
||||
|
||||
@ -1420,10 +1420,6 @@ pub const Zld = struct {
|
||||
pub fn deinit(self: *Zld) void {
|
||||
const gpa = self.gpa;
|
||||
|
||||
for (self.archives.items) |archive| {
|
||||
archive.file.close();
|
||||
}
|
||||
|
||||
self.tlv_ptr_entries.deinit(gpa);
|
||||
self.tlv_ptr_table.deinit(gpa);
|
||||
self.got_entries.deinit(gpa);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user