aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorjim price <shadeops@gmail.com>2023-03-05 16:39:56 -0800
committerAndrew Kelley <andrew@ziglang.org>2023-03-06 15:59:18 -0500
commit6ab04b59417eb9c7fff81ea26424c2340dc72097 (patch)
tree95a929045abb767ad47351af05778fb1ff0a6d32 /src/main.zig
parent27701596060c7a8018f9a9add21952a6d7f83d96 (diff)
downloadzig-6ab04b59417eb9c7fff81ea26424c2340dc72097.tar.gz
zig-6ab04b59417eb9c7fff81ea26424c2340dc72097.zip
std.os: Allow write functions to return INVAL errors
In Linux when interacting with the virtual file system when writing in invalid value to a file the OS will return errno 22 (INVAL). Instead of triggering an unreachable, this change now returns a newly introduced error.InvalidArgument.
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/main.zig b/src/main.zig
index fb02628c61..b134b7183e 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -4622,6 +4622,7 @@ const FmtError = error{
ConnectionResetByPeer,
LockViolation,
NetNameDeleted,
+ InvalidArgument,
} || fs.File.OpenError;
fn fmtPath(fmt: *Fmt, file_path: []const u8, check_mode: bool, dir: fs.Dir, sub_path: []const u8) FmtError!void {