Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

pass SIGINT to the child process then reset to default handler

  • Loading branch information...
commit af75e8e52801062dfc94f5d5d9548dc5c1a49b3d 1 parent d3025cc
@DRMacIver authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  lib/pageme.rb
View
3  lib/pageme.rb
@@ -72,6 +72,8 @@ def page *args, &p
r.close
end
+ Kernel.trap("SIGINT"){ Process.kill "INT", child_pid }
+
begin
page_to w, args
rescue Errno::EPIPE
@@ -84,6 +86,7 @@ def page *args, &p
ensure
w.close
Process.wait child_pid
+ Kernel.trap("SIGINT", "DEFAULT")
File.delete(t) if t
server.close if server
end
Please sign in to comment.
Something went wrong with that request. Please try again.