only weaken when required
[scpubgit/Tak.git] / lib / Tak / STDIOSetup.pm
index 1a9fc9e..30c9851 100644 (file)
@@ -34,12 +34,13 @@ sub run {
     on_close => sub { $done = 1 }
   );
   $connection->receiver->service->register_weak(remote => $connection);
-  if ($0 eq '-') {
-    $0 = 'tak-stdio-node';
-  }
+  $0 = 'tak-stdio-node';
   log_debug { "Node starting" };
-  print $stdout "UP\n";
+  # Tell the other end that we've finished messing around with file
+  # descriptors and that it's therefore safe to start sending requests.
+  print $stdout "Ssyshere\n";
   Tak->loop_until($done);
+  if (our $Next) { goto &$Next }
 }
 
 1;