Changeset 36332 for lang/perl

Show
Ignore:
Timestamp:
01/02/10 10:31:00 (3 years ago)
Author:
kazuho
Message:

bugfix: start_server did not shutdown upon receiving SIGINT while the worker is failing to start up, releng 0.06

Location:
lang/perl/Server-Starter/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Server-Starter/trunk/Changes

    r35597 r36332  
    11Revision history for Perl extension Server::Starter. 
     2 
     30.06  Sat Jan 02 10:26:00 2010 
     4        - bugfix: start_server did not shutdown upon receiving SIGINT while the worker is failing to start up 
    25 
    360.05  Tue Oct 13 20:30:00 2009 
  • lang/perl/Server-Starter/trunk/lib/Server/Starter.pm

    r35597 r36332  
    1212use Exporter qw(import); 
    1313 
    14 our $VERSION = '0.05'; 
     14our $VERSION = '0.06'; 
    1515our @EXPORT_OK = qw(start_server server_ports); 
     16 
     17my @signals_received; 
    1618 
    1719sub start_server { 
     
    6567     
    6668    # setup signal handlers 
    67     my @signals_received; 
    6869    $SIG{$_} = sub { 
    6970        push @signals_received, $_[0]; 
     
    149150        print STDERR "starting new worker $pid\n"; 
    150151        sleep $opts->{interval}; 
    151         if (waitpid($pid, WNOHANG) <= 0) { 
     152        if ((grep { $_ ne 'HUP' } @signals_received) 
     153                || waitpid($pid, WNOHANG) <= 0) { 
    152154            last; 
    153155        }