zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 6a1fd3c69db486df7a805d211e484c60efe294ae (tree)
parent 8a80b5464022a9fb4320e37f9dfc2aa83539ff07
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Wed, 28 Jan 2026 00:01:41 -0800

std.Io.File.MultiReader: make checkAnyError exclude EndOfStream

Diffstat:
Mlib/std/Build/Step/Run.zig | 6++----
Mlib/std/Io/File/MultiReader.zig | 10++++++----
2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/std/Build/Step/Run.zig b/lib/std/Build/Step/Run.zig @@ -1385,14 +1385,12 @@ fn runCommand( break :term spawnChildAndCollect(run, interp_argv.items, &environ_map, has_side_effects, options, fuzz_context) catch |e| { if (!run.failing_to_execute_foreign_is_an_error) return error.MakeSkipped; if (e == error.MakeFailed) return error.MakeFailed; // error already reported - return step.fail("unable to spawn interpreter {s}: {s}", .{ - interp_argv.items[0], @errorName(e), - }); + return step.fail("unable to spawn interpreter {s}: {t}", .{ interp_argv.items[0], e }); }; } if (err == error.MakeFailed) return error.MakeFailed; // error already reported - return step.fail("failed to spawn and capture stdio from {s}: {s}", .{ argv[0], @errorName(err) }); + return step.fail("failed to spawn and capture stdio from {s}: {t}", .{ argv[0], err }); }; const generic_result = opt_generic_result orelse { diff --git a/lib/std/Io/File/MultiReader.zig b/lib/std/Io/File/MultiReader.zig @@ -17,7 +17,8 @@ pub const Context = struct { err: ?Error, }; -pub const Error = Allocator.Error || File.ReadStreamingError || Io.ConcurrentError; +pub const Error = UnendingError || error{EndOfStream}; +pub const UnendingError = Allocator.Error || File.Reader.Error || Io.ConcurrentError; /// Trailing: /// * `contexts: [len]Context` @@ -126,13 +127,14 @@ pub fn reader(mr: *MultiReader, index: usize) *Io.Reader { } /// Checks for errors in all streams, prioritizing `error.Canceled` if it -/// occurred anywhere. -pub fn checkAnyError(mr: *const MultiReader) Error!void { +/// occurred anywhere, and ignoring `error.EndOfStream`. +pub fn checkAnyError(mr: *const MultiReader) UnendingError!void { const contexts = mr.streams.contexts(); - var other: Error!void = {}; + var other: UnendingError!void = {}; for (contexts) |*context| { if (context.err) |err| switch (err) { error.Canceled => |e| return e, + error.EndOfStream => continue, else => |e| other = e, }; }