Skip Menu |

This queue is for tickets about the Net-Server CPAN distribution.

Report information
The Basics
Id: 70547
Status: resolved
Priority: 0/
Queue: Net-Server

People
Owner: Nobody in particular
Requestors: avar [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.99.6.1
Fixed in: (no value)



Subject: Net::Server::PreFork uses $! incorrectly, reports invalid errors
run_n_children() doesn't localize $! before calling fork, and furthermore if the fork fails it does a close() on two filehandles, which would corrupt the value of $! even if it was set correctly. Here's a fork that's failing (I haven't found out why yet) which will report "Bad Fork [Illegal seek]": my $pid = fork; ### trouble if( not defined $pid ){ if( $prop->{child_communication} ){ $parentsock->close(); $childsock->close(); } $self->fatal("Bad fork [$!]"); Instead you should do: local $!; my $pid = fork(); my $pid_error = "$!"; etc. then say "Bad fork [$pid_error]".
All of the forking servers have been updated to handle this correctly. Thank you for the patch. The code is updated as of the just released version 2.000