summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaikari <[email protected]>2026-01-27 06:04:17 +0300
committerSaikari <[email protected]>2026-01-27 06:04:17 +0300
commit666f5c5b7f29beb474b1c12726f8dd39cd1babe9 (patch)
tree5bb1bf98c4356caf24b07d7a170cbd43b3c3ceee
parent41e460c869c15699d63f39e4fe433d88225818dc (diff)
refactor _find_shell_from_parent function to simplify error handling for shell path retrieval
-rw-r--r--xmake/core/base/tty.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/xmake/core/base/tty.lua b/xmake/core/base/tty.lua
index 788327d20..5c7f360c2 100644
--- a/xmake/core/base/tty.lua
+++ b/xmake/core/base/tty.lua
@@ -274,8 +274,8 @@ function tty._find_shell_from_parent()
local shell_name = nil
local shell_path = nil
if os.isfile("/proc/" .. ppid .. "/exe") then
- local ok, link = pcall(os.readlink, "/proc/" .. ppid .. "/exe")
- if ok and link then
+ local link = os.readlink("/proc/" .. ppid .. "/exe")
+ if link then
shell_path = link
end
end