diff options
| author | Stephen Gregoratto <dev@sgregoratto.me> | 2023-11-04 17:06:16 +1100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-01-13 23:52:01 -0700 |
| commit | bc69d62669fac591bda4c91d695d32cf2b78f34c (patch) | |
| tree | a726f05b28feb98e49666bc6fdb82e5bece6efed /src/link/Wasm.zig | |
| parent | cf6751ae5510964f0d349e6ea044d8f618ba6e33 (diff) | |
| download | zig-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.zig | 5 |
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, + }; } } |
