Fixed the fork and restart bug
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine / HTTP / Restarter.pm
index df55656..42f57dd 100644 (file)
@@ -11,14 +11,8 @@ sub run {
 
     $options ||= {};
 
-    die qq/Sorry, but "restart" doesn't work together with "fork".\n/
-      if $options->{fork};
-
     # Setup restarter
-    my $restarter;
-    my $parent = $$;
-
-    unless ( $restarter = fork ) {
+    unless ( my $restarter = fork ) {
 
         # Prepare
         close STDIN;
@@ -57,7 +51,7 @@ sub run {
 
                 # build the Kill request
                 my $req =
-                  HTTP::Request->new( 'KILL', '/',
+                  HTTP::Request->new( 'RESTART', '/',
                     HTTP::Headers->new( 'Connection' => 'close' ) );
                 $req->protocol('HTTP/1.0');