summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2007-08-17 18:36:18 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2007-08-17 18:36:18 -0500
commit8034d023ee48d1f06aa83c9c0e17251290be159a (patch)
tree4648d8187f4a9229842bf7d26f8961288c53bc4f
parente1eb58c9f23ad9abab163c182a223caf053d7d87 (diff)
downloadio-pty-easy-8034d023ee48d1f06aa83c9c0e17251290be159a.tar.gz
io-pty-easy-8034d023ee48d1f06aa83c9c0e17251290be159a.zip
don't allow a subprocess to be spawned if one is already running
-rw-r--r--lib/IO/Pty/Easy.pm3
1 files changed, 3 insertions, 0 deletions
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)) {