Commit 701d4bc80b

Andrew Kelley <andrew@ziglang.org>
2025-10-23 18:48:16
objcopy: update for std.Io API
1 parent 5c527a1
Changed files (1)
lib
compiler
lib/compiler/objcopy.zig
@@ -156,7 +156,7 @@ fn cmdObjCopy(gpa: Allocator, arena: Allocator, args: []const []const u8) !void
 
     const stat = input_file.stat() catch |err| fatal("failed to stat {s}: {t}", .{ input, err });
 
-    var in: File.Reader = .initSize(input_file, io, &input_buffer, stat.size);
+    var in: File.Reader = .initSize(input_file.adaptToNewApi(), io, &input_buffer, stat.size);
 
     const elf_hdr = std.elf.Header.read(&in.interface) catch |err| switch (err) {
         error.ReadFailed => fatal("unable to read {s}: {t}", .{ input, in.err.? }),
@@ -221,7 +221,7 @@ fn cmdObjCopy(gpa: Allocator, arena: Allocator, args: []const []const u8) !void
     try out.end();
 
     if (listen) {
-        var stdin_reader = fs.File.stdin().reader(&stdin_buffer);
+        var stdin_reader = fs.File.stdin().reader(io, &stdin_buffer);
         var stdout_writer = fs.File.stdout().writer(&stdout_buffer);
         var server = try Server.init(.{
             .in = &stdin_reader.interface,