Skip to content

Instantly share code, notes, and snippets.

@nihen
Created August 3, 2010 13:01
Show Gist options
  • Save nihen/506332 to your computer and use it in GitHub Desktop.
Save nihen/506332 to your computer and use it in GitHub Desktop.
diff --git lib/Plack/Loader/Restarter.pm lib/Plack/Loader/Restarter.pm
index 4a79bbd..f4051be 100644
--- lib/Plack/Loader/Restarter.pm
+++ lib/Plack/Loader/Restarter.pm
@@ -23,6 +23,8 @@ sub watch {
sub _fork_and_start {
my($self, $server) = @_;
+ $self->{pid} = undef;
+
my $pid = fork;
die "Can't fork: $!" unless defined $pid;
@@ -76,6 +78,7 @@ sub run {
$self->_kill_child;
$self->_fork_and_start($server, $builder);
+ return unless $self->{pid};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment