[Bps-public-commit] r17003 - in HTTP-Server-Simple: .
alexmv at bestpractical.com
alexmv at bestpractical.com
Sun Nov 23 01:51:09 EST 2008
Author: alexmv
Date: Sun Nov 23 01:51:09 2008
New Revision: 17003
Modified:
HTTP-Server-Simple/ (props changed)
HTTP-Server-Simple/lib/HTTP/Server/Simple.pm
Log:
r39413 at kohr-ah: chmrr | 2008-11-23 01:20:28 -0500
* "die" -> "croak"
Modified: HTTP-Server-Simple/lib/HTTP/Server/Simple.pm
==============================================================================
--- HTTP-Server-Simple/lib/HTTP/Server/Simple.pm (original)
+++ HTTP-Server-Simple/lib/HTTP/Server/Simple.pm Sun Nov 23 01:51:09 2008
@@ -216,13 +216,13 @@
sub background {
my $self = shift;
my $child = fork;
- die "Can't fork: $!" unless defined($child);
+ croak "Can't fork: $!" unless defined($child);
return $child if $child;
if ( $^O !~ /MSWin32/ ) {
require POSIX;
POSIX::setsid()
- or die "Can't start a new session: $!";
+ or croak "Can't start a new session: $!";
}
$self->run(@_);
}
@@ -473,7 +473,7 @@
croak "do not call " . ref($self) . "::SUPER->handler";
}
else {
- die "handler called out of context";
+ croak "handler called out of context";
}
}
@@ -665,8 +665,7 @@
my $self = shift;
my $tcp = getprotobyname('tcp');
-
- socket( HTTPDaemon, PF_INET, SOCK_STREAM, $tcp ) or die "socket: $!";
+ socket( HTTPDaemon, PF_INET, SOCK_STREAM, $tcp ) or croak "socket: $!";
setsockopt( HTTPDaemon, SOL_SOCKET, SO_REUSEADDR, pack( "l", 1 ) )
or warn "setsockopt: $!";
bind( HTTPDaemon,
@@ -678,8 +677,8 @@
)
)
)
- or die "bind: $!";
- listen( HTTPDaemon, SOMAXCONN ) or die "listen: $!";
+ or croak "bind to @{[$self->host||'*']}:@{[$self->port]}: $!";
+ listen( HTTPDaemon, SOMAXCONN ) or croak "listen: $!";
}
More information about the Bps-public-commit
mailing list