From 8034d023ee48d1f06aa83c9c0e17251290be159a Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Fri, 17 Aug 2007 18:36:18 -0500 Subject: don't allow a subprocess to be spawned if one is already running --- lib/IO/Pty/Easy.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/IO/Pty/Easy.pm b/lib/IO/Pty/Easy.pm index 791ba76..a75b391 100644 --- a/lib/IO/Pty/Easy.pm +++ b/lib/IO/Pty/Easy.pm @@ -113,6 +113,9 @@ sub spawn { my $self = shift; my $slave = $self->{pty}->slave; + croak "Attempt to spawn a subprocess when one is already running" + if $self->is_active; + # set up a pipe to use for keeping track of the child process during exec my ($readp, $writep); unless (pipe($readp, $writep)) { -- cgit v1.2.3-54-g00ecf