diff lib/Test/Nginx.pm @ 415:020c4e47ecac

Tests: revert 068d020a8f85 and localize $? instead. The problem observed was due to $? being overwritten in the destructor after it has been set by exit(), specifically by waitpid() in stop_daemons(). Fix is to localize $? in the destructor to make sure it won't be accidentally changed.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 20 Jun 2014 21:01:52 +0400
parents 17c5a1cc8757
children 60888e2c3f5a
line wrap: on
line diff
--- a/lib/Test/Nginx.pm
+++ b/lib/Test/Nginx.pm
@@ -51,9 +51,13 @@ sub new {
 
 sub DESTROY {
 	my ($self) = @_;
+	local $?;
+
 	return if $self->{_pid} != $$;
+
 	$self->stop();
 	$self->stop_daemons();
+
 	if ($ENV{TEST_NGINX_CATLOG}) {
 		system("cat $self->{_testdir}/error.log");
 	}