From 6779f24eb5fc49805b65a7a5b270e0130269754b Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 8 Apr 2013 05:12:08 +0000 Subject: test_curses.rb: add sentinel * test/test_curses.rb (TestCurses#run_curses): add sentinel to get rid of read pty output after the child process terminated, which causes EIO on Linux. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/test_curses.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/test_curses.rb b/test/test_curses.rb index 9432c024bb..752fa47c29 100644 --- a/test/test_curses.rb +++ b/test/test_curses.rb @@ -28,14 +28,16 @@ rescue Exception => e ensure close_screen puts "", [Marshal.dump([result, e])].pack('m').delete("\n") + print "\\0" end src if input w.print(input) w.flush end - res = r.read + res = r.gets("\0") return unless res + res.chomp!("\0") res, error = Marshal.load(res[/(.*)\Z/, 1].unpack('m')[0]) raise error if error return res -- cgit v1.2.3