Commit 4633e56c authored by Camilo Lopez's avatar Camilo Lopez

Make sure that a tracer will exit when the socket has no data AND the pid is gone

parent 5cb4a83d
......@@ -246,16 +246,22 @@ class RBTracer
# Process events from the traced process.
#
# Returns nothing.
# Returns nothing
def recv_loop
while true
# block until a message arrives
process_line(recv_cmd)
ready = IO.select([@sock], nil, nil, 1)
if ready
# block until a message arrives
process_line(recv_cmd)
# process any remaining messages
recv_lines
else
Process.kill(0, @pid)
end
# process any remaining messages
recv_lines
end
rescue Errno::EINVAL, Errno::EIDRM
rescue Errno::EINVAL, Errno::EIDRM, Errno::ESRCH
# process went away
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment