Skip to content

Commit

Permalink
frozen on Ruby 3+
Browse files Browse the repository at this point in the history
  • Loading branch information
kobaltz committed Mar 3, 2024
1 parent 3a3d01d commit cb84e97
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/clamby/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,16 @@ def self.scan(path)

# $CHILD_STATUS maybe nil if the execution itself (not the client process)
# fails
case $CHILD_STATUS && $CHILD_STATUS.exitstatus
child_status = $CHILD_STATUS.dup # $CHILD_STATUS in Ruby 3.0+ is frozen
case child_status && child_status.exitstatus
when 0
return false
when nil, 2
# clamdscan returns 2 whenever error other than a detection happens
if Clamby.config[:error_clamscan_client_error] && Clamby.config[:daemonize]
raise Clamby::ClamscanClientError.new("Clamscan client error")
end

# returns true to maintain legacy behavior
return true
else
Expand Down

0 comments on commit cb84e97

Please sign in to comment.