summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/IO/Pty/Easy.pm4
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';