# HG changeset patch # User Maxim Dounin # Date 1338684974 -14400 # Node ID 5b7883daaf82beb06eb46a662c566a3dcd73f870 # Parent 8d2c6358d830a4ec73a963d7131d38218ee839b2 Tests: use kill(9, $pid) on win32. Change daemon termination to use kill(9, $pid) on win32, as normally used kill(TERM, $pid) doesn't work with perlfork emulation and causes process hangs. diff --git a/lib/Test/Nginx.pm b/lib/Test/Nginx.pm --- a/lib/Test/Nginx.pm +++ b/lib/Test/Nginx.pm @@ -210,9 +210,9 @@ sub stop() { my @globals = $self->{_test_globals} ? () : ('-g', "pid $testdir/nginx.pid; " . "error_log $testdir/error.log debug;"); - exec($NGINX, '-c', "$testdir/nginx.conf", '-s', 'stop', - @globals) - or die "Unable to exec(): $!\n"; + system($NGINX, '-c', "$testdir/nginx.conf", '-s', 'stop', + @globals) == 0 + or die "system() failed: $?\n"; } else { kill 'QUIT', `cat $self->{_testdir}/nginx.pid`; @@ -230,7 +230,7 @@ sub stop_daemons() { while ($self->{_daemons} && scalar @{$self->{_daemons}}) { my $p = shift @{$self->{_daemons}}; - kill 'TERM', $p; + kill $^O eq 'MSWin32' ? 9 : 'TERM', $p; wait; }