From f7aa10ba23c804876a20dc52da0664e0ff3dbf4a Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Tue, 25 Jun 2024 04:42:27 -0300 Subject: [PATCH] Update bsd/capsicum.rb --- lib/bsd/capsicum.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bsd/capsicum.rb b/lib/bsd/capsicum.rb index d4b0cdf..f2bfd48 100644 --- a/lib/bsd/capsicum.rb +++ b/lib/bsd/capsicum.rb @@ -38,7 +38,7 @@ module BSD::Capsicum # @return [Boolean] # Returns true when successful def enter! - return true unless FFI.cap_enter == -1 - raise SystemCallError.new("cap_enter", Fiddle.last_error) + FFI.cap_enter.zero? || + raise(SystemCallError.new("cap_enter", Fiddle.last_error)) end end