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
def ignore_interrupts(_opt = nil)
def ignore_interrupts(quiet: false)
IGNORE_INTERRUPTS_MUTEX.synchronize do
# rubocop:disable Style/GlobalVars
$ignore_interrupts_nesting_level = 0 unless defined?($ignore_interrupts_nesting_level)
@ -360,8 +360,11 @@ module Kernel
$ignore_interrupts_interrupted = false unless defined?($ignore_interrupts_interrupted)
old_sigint_handler = trap(:INT) do
$ignore_interrupts_interrupted = true
$stderr.print "\n"
$stderr.puts "One sec, cleaning up..."
unless quiet
$stderr.print "\n"
$stderr.puts "One sec, cleaning up..."
end
end
begin

View File

@ -75,7 +75,7 @@ module Utils
exit!(true)
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
socket = server.accept_nonblock
rescue Errno::EAGAIN, Errno::EWOULDBLOCK, Errno::ECONNABORTED, Errno::EPROTO, Errno::EINTR