summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-02-03 22:46:15 -0500
committerdoy <doy@tozt.net>2009-02-03 22:46:15 -0500
commit9217deeff0cae350ee86200e89bf25adb29bf991 (patch)
tree906eeecbcdaaf3a057bd1890de3289ec6bbbdbc1
parent2623b8edff6b776a5972edb2b1ef702e55340549 (diff)
downloadio-pty-easy-9217deeff0cae350ee86200e89bf25adb29bf991.tar.gz
io-pty-easy-9217deeff0cae350ee86200e89bf25adb29bf991.zip
a few minor cleanups
-rw-r--r--lib/IO/Pty/Easy.pm14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/IO/Pty/Easy.pm b/lib/IO/Pty/Easy.pm
index 644b1da..8ec03fe 100644
--- a/lib/IO/Pty/Easy.pm
+++ b/lib/IO/Pty/Easy.pm
@@ -82,8 +82,9 @@ sub new {
@_,
# state
- pty => undef,
- pid => undef,
+ pty => undef,
+ pid => undef,
+ final_output => '',
};
bless $self, $class;
@@ -155,7 +156,6 @@ sub spawn {
close $writep;
$self->{pty}->close_slave;
$self->{pty}->set_raw;
- $self->{final_output} = '';
# this sysread will block until either we get an EOF from the other end of
# the pipe being closed due to the exec, or until the child process sends
# us the errno of the exec call after it fails
@@ -256,14 +256,14 @@ sub is_active {
my $self = shift;
return 0 unless defined $self->{pid};
- # XXX XXX XXX FreeBSD 7.0 will not allow a session leader to exit
- # until the kernel tty output buffer is empty. Make it so.
+ # XXX FreeBSD 7.0 will not allow a session leader to exit until the kernel
+ # tty output buffer is empty. Make it so.
my $rin = '';
vec($rin, fileno($self->{pty}), 1) = 1;
my $nfound = select($rin, undef, undef, 0);
if ($nfound > 0) {
- sysread($self->{pty}, $self->{final_output},
- $self->{def_max_read_chars}, length $self->{final_output});
+ sysread($self->{pty}, $self->{final_output},
+ $self->{def_max_read_chars}, length $self->{final_output});
}
my $active = kill 0 => $self->{pid};