Skip to content

Commit

Permalink
Fix Process.exists? throwing errors on EPERM (#13911)
Browse files Browse the repository at this point in the history
  • Loading branch information
refi64 authored Oct 31, 2023
1 parent 4c836be commit c97c20e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/crystal/system/unix/process.cr
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,14 @@ struct Crystal::System::Process
if ret == 0
true
else
return false if Errno.value == Errno::ESRCH
raise RuntimeError.from_errno("kill")
case Errno.value
when Errno::EPERM
true
when Errno::ESRCH
false
else
raise RuntimeError.from_errno("kill")
end
end
end

Expand Down

0 comments on commit c97c20e

Please sign in to comment.