From bc69d62669fac591bda4c91d695d32cf2b78f34c Mon Sep 17 00:00:00 2001 From: Stephen Gregoratto Date: Sat, 4 Nov 2023 17:06:16 +1100 Subject: 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. --- src/link/Wasm.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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, + }; } } -- cgit v1.2.3