aboutsummaryrefslogtreecommitdiff
path: root/src/link/Wasm.zig
diff options
context:
space:
mode:
authorStephen Gregoratto <dev@sgregoratto.me>2023-11-04 17:06:16 +1100
committerAndrew Kelley <andrew@ziglang.org>2024-01-13 23:52:01 -0700
commitbc69d62669fac591bda4c91d695d32cf2b78f34c (patch)
treea726f05b28feb98e49666bc6fdb82e5bece6efed /src/link/Wasm.zig
parentcf6751ae5510964f0d349e6ea044d8f618ba6e33 (diff)
downloadzig-bc69d62669fac591bda4c91d695d32cf2b78f34c.tar.gz
zig-bc69d62669fac591bda4c91d695d32cf2b78f34c.zip
Linux: Add fchmodat fallback when `flags` is nonzero
The check for determining whether to use the fallback code has been moved into an inline function as per Andrew's comments in #17954.
Diffstat (limited to 'src/link/Wasm.zig')
-rw-r--r--src/link/Wasm.zig5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/link/Wasm.zig b/src/link/Wasm.zig
index 6f20e86bdc..a0cf23579b 100644
--- a/src/link/Wasm.zig
+++ b/src/link/Wasm.zig
@@ -4917,7 +4917,10 @@ fn linkWithLLD(wasm: *Wasm, arena: Allocator, prog_node: *std.Progress.Node) !vo
// report a nice error here with the file path if it fails instead of
// just returning the error code.
// chmod does not interact with umask, so we use a conservative -rwxr--r-- here.
- try std.os.fchmodat(fs.cwd().fd, full_out_path, 0o744, 0);
+ std.os.fchmodat(fs.cwd().fd, full_out_path, 0o744, 0) catch |err| switch (err) {
+ error.OperationNotSupported => unreachable, // Not a symlink.
+ else => |e| return e,
+ };
}
}