aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-12-28 03:35:03 -0800
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-12-28 03:35:03 -0800
commit6f4d48cc6cf01e10bcae1b0be85920791c7a7fd6 (patch)
tree1d1fd167190655e8c96330ee730b2ca82d15f68a
parentfb34ebc674d099209963d9c1d5eccbd1726d3b5d (diff)
downloadbun-6f4d48cc6cf01e10bcae1b0be85920791c7a7fd6.tar.gz
bun-6f4d48cc6cf01e10bcae1b0be85920791c7a7fd6.tar.zst
bun-6f4d48cc6cf01e10bcae1b0be85920791c7a7fd6.zip
[bun run] revert changebun-v0.0.62
-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);
}