diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rbot/ircbot.rb | 10 |
1 files 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 |