summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2007-08-17 18:27:23 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2007-08-17 18:27:23 -0500
commitd6ed1f43c55212b529c539032076ca90c5a041d2 (patch)
tree7d9ac450cf3e3379a091c24d065d03d7fc86c892 /lib
parent1757478ae658a89400792db79651ccbf4a422ed2 (diff)
downloadio-pty-easy-d6ed1f43c55212b529c539032076ca90c5a041d2.tar.gz
io-pty-easy-d6ed1f43c55212b529c539032076ca90c5a041d2.zip
make spawn wait for the child to die before returning if there was an error
Diffstat (limited to 'lib')
-rw-r--r--lib/IO/Pty/Easy.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/IO/Pty/Easy.pm b/lib/IO/Pty/Easy.pm
index 64e09e8..ac72818 100644
--- a/lib/IO/Pty/Easy.pm
+++ b/lib/IO/Pty/Easy.pm
@@ -161,11 +161,13 @@ sub spawn {
unless (defined $read_bytes) {
kill TERM => $self->{pid};
close $readp;
+ $self->_wait_for_inactive;
croak "Cannot sync with child: $!";
}
close $readp;
if ($read_bytes > 0) {
$errno = $errno + 0;
+ $self->_wait_for_inactive;
croak "Cannot exec(@_): $errno";
}