Clean up named pipes
This commit is contained in:
parent
64278b6573
commit
519c05d9c9
@ -126,6 +126,20 @@ def set_up_named_pipes(control_socket, connection_id)
|
|||||||
$stderr.reopen(stderr)
|
$stderr.reopen(stderr)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def clean_up_named_pipes(control_socket, connection_id)
|
||||||
|
pipe_base_path = "/#{$run_base_path}/github-fast-envd.#{connection_id}"
|
||||||
|
|
||||||
|
if File.exist?("#{pipe_base_path}.stdin")
|
||||||
|
File.delete("#{pipe_base_path}.stdin")
|
||||||
|
end
|
||||||
|
if File.exist?("#{pipe_base_path}.stdout")
|
||||||
|
File.delete("#{pipe_base_path}.stdout")
|
||||||
|
end
|
||||||
|
if File.exist?("#{pipe_base_path}.stderr")
|
||||||
|
File.delete("#{pipe_base_path}.stderr")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def set_up_pseudoterminal(control_socket, pseudoterminal_path)
|
def set_up_pseudoterminal(control_socket, pseudoterminal_path)
|
||||||
pseudoterminal_io = File.open(pseudoterminal_path, File::RDWR | File::NOCTTY)
|
pseudoterminal_io = File.open(pseudoterminal_path, File::RDWR | File::NOCTTY)
|
||||||
|
|
||||||
@ -235,6 +249,10 @@ while true
|
|||||||
end
|
end
|
||||||
control_socket.close
|
control_socket.close
|
||||||
|
|
||||||
|
if mode == "named-pipes"
|
||||||
|
clean_up_named_pipes(control_socket, connection_id)
|
||||||
|
end
|
||||||
|
|
||||||
$original_stderr.puts " finished handling request (#{process_id})"
|
$original_stderr.puts " finished handling request (#{process_id})"
|
||||||
|
|
||||||
Kernel.exit!
|
Kernel.exit!
|
||||||
|
Loading…
Reference in New Issue
Block a user