From d6ed1f43c55212b529c539032076ca90c5a041d2 Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Fri, 17 Aug 2007 18:27:23 -0500 Subject: make spawn wait for the child to die before returning if there was an error --- lib/IO/Pty/Easy.pm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') 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"; } -- cgit v1.2.3-54-g00ecf