Skip to content
This repository has been archived by the owner on Feb 28, 2018. It is now read-only.

Commit

Permalink
Fixes #254: Exception on CTRL+C
Browse files Browse the repository at this point in the history
  • Loading branch information
evilsocket committed Aug 11, 2016
1 parent 564d3bc commit 4f9be71
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions bin/bettercap
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,15 @@ rescue Exception => e
BetterCap::Logger.error "Backtrace :\n\n #{e.backtrace.join("\n ")}\n"

ensure
# handle double ctrl+c nicely
trap("INT") { }

# Make sure all the messages on the logger queue are printed.
BetterCap::Logger.wait!
begin
BetterCap::Logger.wait!
rescue; end

ctx.finalize unless ctx.nil?
begin
ctx.finalize unless ctx.nil?
rescue; end
end

0 comments on commit 4f9be71

Please sign in to comment.