Browse Source

Clean up named pipes

master
Patrick Lühne 2 years ago
parent
commit
519c05d9c9
Signed by: patrick GPG Key ID: 05F3611E97A70ABF
  1. 18
      github-fast-env/github-fast-envd.rb

18
github-fast-env/github-fast-envd.rb

@ -126,6 +126,20 @@ def set_up_named_pipes(control_socket, connection_id)
$stderr.reopen(stderr)
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)
pseudoterminal_io = File.open(pseudoterminal_path, File::RDWR | File::NOCTTY)
@ -235,6 +249,10 @@ while true
end
control_socket.close
if mode == "named-pipes"
clean_up_named_pipes(control_socket, connection_id)
end
$original_stderr.puts " finished handling request (#{process_id})"
Kernel.exit!

Loading…
Cancel
Save