Subject: | exit value is automatically set to -1 (255) when a program including threads uses 'Net::SCP::Expect' - this breaks Test::* |
Date: | Tue, 11 Mar 2008 16:04:36 -0700 |
To: | bug-Net-SCP-Expect [...] rt.cpan.org |
From: | ashleyb <ian.brown [...] gmail.com> |
when a script that uses threads also uses this module
('Net::SCP::Expect') then the return value of the script can
automatically be set to -1 (255).
This is because Net::SCP::Expect sets $SIG{CHLD} with a subroutine
that reaps the children with:
sub reapChild{
do {} while waitpid(-1,WNOHANG) > 0; # line 274
}
always returns -1 and this becomes the exit value of the script.
This breaks the Test::Harness as it figures this test file is failed
because it has a non-zero exit value.
to fix this just return zero from reapChild.