From e5231b624227cba11ab6cf0825ff3daf328eebd7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 20 Jan 2020 09:08:14 +0000 Subject: test_helper: remove unused `chunked_spawn' It was added nearly 11 years ago in commit 6945342a1f0a4caa ("Transfer-Encoding: chunked streaming input support") but never used. --- test/test_helper.rb | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/test/test_helper.rb b/test/test_helper.rb index c21f75d..94a5b1b 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -265,32 +265,6 @@ def wait_for_death(pid) raise "PID:#{pid} never died!" end -# executes +cmd+ and chunks its STDOUT -def chunked_spawn(stdout, *cmd) - fork { - crd, cwr = IO.pipe - crd.binmode - cwr.binmode - crd.sync = cwr.sync = true - - pid = fork { - STDOUT.reopen(cwr) - crd.close - cwr.close - exec(*cmd) - } - cwr.close - begin - buf = crd.readpartial(16384) - stdout.write("#{'%x' % buf.size}\r\n#{buf}") - rescue EOFError - stdout.write("0\r\n") - pid, status = Process.waitpid(pid) - exit status.exitstatus - end while true - } -end - def reset_sig_handlers %w(WINCH QUIT INT TERM USR1 USR2 HUP TTIN TTOU CHLD).each do |sig| trap(sig, "DEFAULT") -- cgit v1.2.3-24-ge0c7