diff options
author | doy <doy@tozt.net> | 2009-02-03 03:53:54 -0500 |
---|---|---|
committer | doy <doy@tozt.net> | 2009-02-03 03:53:54 -0500 |
commit | b60c8a20f48e8db075b0d3cbd0557295b2fa2c69 (patch) | |
tree | af5e4b423bb4f19f204cfb1c2964ee2b81790998 /lib | |
parent | 29536ca2109821ba3d3cda013c5cb8b67c196c0d (diff) | |
download | io-pty-easy-b60c8a20f48e8db075b0d3cbd0557295b2fa2c69.tar.gz io-pty-easy-b60c8a20f48e8db075b0d3cbd0557295b2fa2c69.zip |
clean up signals a bit better
Diffstat (limited to 'lib')
-rw-r--r-- | lib/IO/Pty/Easy.pm | 9 |
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; } # }}} |