[PATCH 2/3] test-terminal: set output terminals to raw mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Not setting them to raw mode causes funny things to happen, such as
\n -> \r\n translation:

  ./test-terminal.perl echo foo | xxd
  0000000: 666f 6f0d 0a                             foo..

(Notice the added 0d.)

To avoid this, set the (pseudo)terminal to raw mode.  Note that the
IO::Pty docs recommend doing it on both master and slave.

Signed-off-by: Thomas Rast <trast@xxxxxxxxxxxxxxx>
---
 t/test-terminal.perl |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/t/test-terminal.perl b/t/test-terminal.perl
index 87b5a8c..a2bfbe5 100755
--- a/t/test-terminal.perl
+++ b/t/test-terminal.perl
@@ -81,6 +81,10 @@ sub set_default_eof_char {
 my $master_in = new IO::Pty;
 my $master_out = new IO::Pty;
 my $master_err = new IO::Pty;
+$master_out->set_raw();
+$master_err->set_raw();
+$master_out->slave->set_raw();
+$master_err->slave->set_raw();
 set_default_eof_char($master_in->slave);
 my $pid = start_child(\@ARGV, $master_in->slave, $master_out->slave, $master_err->slave);
 close $master_in->slave;
-- 
1.7.8.431.g2abf2

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]