aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build-id2
-rw-r--r--src/which.zig3
2 files changed, 2 insertions, 3 deletions
diff --git a/build-id b/build-id
index b1e7d265f..a8fa06e1b 100644
--- a/build-id
+++ b/build-id
@@ -1 +1 @@
-61
+62
diff --git a/src/which.zig b/src/which.zig
index 50c82c05d..69377df63 100644
--- a/src/which.zig
+++ b/src/which.zig
@@ -9,8 +9,7 @@ fn isValid(buf: *[std.fs.MAX_PATH_BYTES]u8, segment: []const u8, bin: []const u8
var stat = std.mem.zeroes(std.os.Stat);
// we cannot use access() here even though all we want to do now here is check it is executable
// directories can be considered executable
- if (std.c.stat(filepath, &stat) != 0) return null;
- if (stat.mode & std.os.S_IXUSR == 0 or !(std.os.S_ISLNK(stat.mode) or std.os.S_ISREG(stat.mode))) return null;
+ std.os.accessZ(filepath, std.os.X_OK) catch return null;
return @intCast(u16, filepath.len);
}