diff options
author | doy <doy@tozt.net> | 2009-02-03 20:03:48 -0500 |
---|---|---|
committer | doy <doy@tozt.net> | 2009-02-03 20:03:48 -0500 |
commit | 03b7e4a77350270c8da1b7a60b93dcc55058c319 (patch) | |
tree | f2ba55343e60f4ee78dd8564926f946a53a483e3 /lib | |
parent | 16686a107165fa22c063d12ba42c6313a0ae1712 (diff) | |
download | io-pty-easy-03b7e4a77350270c8da1b7a60b93dcc55058c319.tar.gz io-pty-easy-03b7e4a77350270c8da1b7a60b93dcc55058c319.zip |
cleaner logic in is_active
Diffstat (limited to 'lib')
-rw-r--r-- | lib/IO/Pty/Easy.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/IO/Pty/Easy.pm b/lib/IO/Pty/Easy.pm index 397bf6d..24f0fa6 100644 --- a/lib/IO/Pty/Easy.pm +++ b/lib/IO/Pty/Easy.pm @@ -253,8 +253,8 @@ Returns whether or not a subprocess is currently running on the pty. sub is_active { my $self = shift; - my $active = defined($self->{pid}); - $active = kill 0 => $self->{pid} if $active; + return 0 unless defined $self->{pid}; + my $active = kill 0 => $self->{pid}; if (!$active) { delete $self->{pid}; $SIG{WINCH} = 'DEFAULT'; |