Subject: | Small patch so things work on Windows. |
Index: t/01live.t
===================================================================
--- t/01live.t (revision 2118)
+++ t/01live.t (working copy)
@@ -11,7 +11,7 @@
my $s=HTTP::Server::Simple->new(13432);
is($s->port(),13432,"Constructor set port correctly");
my $pid=$s->background();
-like($pid, qr/^\d+$/,'pid is numeric');
+like($pid, qr/^-?\d+$/,'pid is numeric');
my $content=LWP::Simple::get("http://localhost:13432");
like($content,qr/Congratulations/,"Returns a page");
is(kill(9,$pid),1,'Signaled 1 process successfully');
Index: lib/HTTP/Server/Simple.pm
===================================================================
--- lib/HTTP/Server/Simple.pm (revision 2118)
+++ lib/HTTP/Server/Simple.pm (working copy)
@@ -79,9 +79,11 @@
my $child =fork ;
die "Can't fork: $!" unless defined($child);
return $child if $child;
+ unless ($^O =~ /win32/i) {
use POSIX;
POSIX::setsid()
or die "Can't start a new session: $!";
+ }
$self->run();
}