summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-02-03 03:53:54 -0500
committerdoy <doy@tozt.net>2009-02-03 03:53:54 -0500
commitb60c8a20f48e8db075b0d3cbd0557295b2fa2c69 (patch)
treeaf5e4b423bb4f19f204cfb1c2964ee2b81790998
parent29536ca2109821ba3d3cda013c5cb8b67c196c0d (diff)
downloadio-pty-easy-b60c8a20f48e8db075b0d3cbd0557295b2fa2c69.tar.gz
io-pty-easy-b60c8a20f48e8db075b0d3cbd0557295b2fa2c69.zip
clean up signals a bit better
-rw-r--r--lib/IO/Pty/Easy.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/IO/Pty/Easy.pm b/lib/IO/Pty/Easy.pm
index 9d2256a..4cf1973 100644
--- a/lib/IO/Pty/Easy.pm
+++ b/lib/IO/Pty/Easy.pm
@@ -254,9 +254,12 @@ Returns whether or not a subprocess is currently running on the pty.
sub is_active {
my $self = shift;
- return 0 unless defined($self->{pid});
- my $active = kill 0 => $self->{pid};
- delete $self->{pid} unless $active;
+ my $active = defined($self->{pid});
+ $active = kill 0 => $self->{pid} if $active;
+ if (!$active) {
+ delete $self->{pid};
+ $SIG{WINCH} = 'DEFAULT';
+ }
return $active;
}
# }}}