Fix unused argument.

This commit is contained in:
Markus Reiter 2024-07-14 13:18:33 -04:00
parent 1b79e01c5b
commit 3c8497647e
No known key found for this signature in database
GPG Key ID: 245293B51702655B
2 changed files with 7 additions and 4 deletions

View File

@ -351,7 +351,7 @@ module Kernel
IGNORE_INTERRUPTS_MUTEX = Thread::Mutex.new.freeze IGNORE_INTERRUPTS_MUTEX = Thread::Mutex.new.freeze
def ignore_interrupts(_opt = nil) def ignore_interrupts(quiet: false)
IGNORE_INTERRUPTS_MUTEX.synchronize do IGNORE_INTERRUPTS_MUTEX.synchronize do
# rubocop:disable Style/GlobalVars # rubocop:disable Style/GlobalVars
$ignore_interrupts_nesting_level = 0 unless defined?($ignore_interrupts_nesting_level) $ignore_interrupts_nesting_level = 0 unless defined?($ignore_interrupts_nesting_level)
@ -360,9 +360,12 @@ module Kernel
$ignore_interrupts_interrupted = false unless defined?($ignore_interrupts_interrupted) $ignore_interrupts_interrupted = false unless defined?($ignore_interrupts_interrupted)
old_sigint_handler = trap(:INT) do old_sigint_handler = trap(:INT) do
$ignore_interrupts_interrupted = true $ignore_interrupts_interrupted = true
unless quiet
$stderr.print "\n" $stderr.print "\n"
$stderr.puts "One sec, cleaning up..." $stderr.puts "One sec, cleaning up..."
end end
end
begin begin
yield yield

View File

@ -75,7 +75,7 @@ module Utils
exit!(true) exit!(true)
end end
ignore_interrupts(:quietly) do # the child will receive the interrupt and marshal it back ignore_interrupts(quiet: true) do # the child will receive the interrupt and marshal it back
begin begin
socket = server.accept_nonblock socket = server.accept_nonblock
rescue Errno::EAGAIN, Errno::EWOULDBLOCK, Errno::ECONNABORTED, Errno::EPROTO, Errno::EINTR rescue Errno::EAGAIN, Errno::EWOULDBLOCK, Errno::ECONNABORTED, Errno::EPROTO, Errno::EINTR