From 03b7e4a77350270c8da1b7a60b93dcc55058c319 Mon Sep 17 00:00:00 2001 From: doy Date: Tue, 3 Feb 2009 20:03:48 -0500 Subject: cleaner logic in is_active --- lib/IO/Pty/Easy.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') 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'; -- cgit v1.2.3-54-g00ecf