summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-02-03 03:34:15 -0500
committerdoy <doy@tozt.net>2009-02-03 03:34:15 -0500
commit531953d43faca2ed99b3ef9a570b5fe66893d90b (patch)
tree59bbe89c97240dcfb98f8af780d404d423dc2359
parent1702788b834945ac554e10bc903ec40bdb429b47 (diff)
downloadio-pty-easy-531953d43faca2ed99b3ef9a570b5fe66893d90b.tar.gz
io-pty-easy-531953d43faca2ed99b3ef9a570b5fe66893d90b.zip
don't fail on multiple close calls
-rw-r--r--lib/IO/Pty/Easy.pm1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/IO/Pty/Easy.pm b/lib/IO/Pty/Easy.pm
index 7df04e3..ae0201a 100644
--- a/lib/IO/Pty/Easy.pm
+++ b/lib/IO/Pty/Easy.pm
@@ -300,6 +300,7 @@ Kills any subprocesses and closes the pty. No other operations are valid after t
sub close {
my $self = shift;
+ return unless defined $self->{pty};
$self->kill;
close $self->{pty};
$self->{pty} = undef;