From 37da205be0c49969bc8dce9c784e785247eb4f30 Mon Sep 17 00:00:00 2001 From: Leon Henrik Plickat Date: Mon, 6 Jun 2022 21:53:55 +0200 Subject: [PATCH] river: error out if default init is not executable --- river/main.zig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/river/main.zig b/river/main.zig index e98ff4c..b0e6579 100644 --- a/river/main.zig +++ b/river/main.zig @@ -140,6 +140,12 @@ fn defaultInitPath() !?[:0]const u8 { }; os.accessZ(path, os.X_OK) catch |err| { + if (err == error.PermissionDenied) { + if (os.accessZ(path, os.R_OK)) { + std.log.err("failed to run init executable {s}: the file is not executable", .{path}); + os.exit(1); + } else |_| {} + } std.log.err("failed to run init executable {s}: {s}", .{ path, @errorName(err) }); util.gpa.free(path); return null;