From c6425686430c97824de999151836854db7893eac Mon Sep 17 00:00:00 2001 From: Tom Gilbert Date: Sat, 27 Aug 2005 13:11:15 +0000 Subject: [PATCH] fix for ticket #17 --- lib/rbot/ircbot.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 12765da2..3881771d 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -311,9 +311,13 @@ class IrcBot # connect the bot to IRC def connect - trap("SIGTERM") { quit } - trap("SIGHUP") { quit } - trap("SIGINT") { quit } + begin + trap("SIGTERM") { quit } + trap("SIGHUP") { quit } + trap("SIGINT") { quit } + rescue + debug "failed to trap signals, probably running on windows?" + end begin @socket.connect rescue => e -- 2.39.5